New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
documentation: no-unsafe-optional-chaining - add needs ecmaVersion: 2020 #14029
Comments
Hi @aavmurphy, thanks for the issue!
The rule itself doesn't require I think that mentioning ecmaVersion in the documentation for a rule makes sense only if the rule auto-fixes code to a newer syntax. For example: prefer-object-spread#when-not-to-use-it
PR to add this example is welcome! |
Hi everyone |
Hi @arminyahya! This rule isn't auto-fixable, since it warns about possible runtime errors and auto-fixes should never change the behavior of the code. I also don't think there are many cases where the rule could provide a suggestion fix. |
In that case, there is nothing to document. Am i right? |
Nothing about the autofixing, but it makes sense to add |
Working on this. |
…efs eslint#14029)" This reverts commit a2ccc04.
Thanks for adding the I still think it worth mentioning: use I was unaware of this config option, so didn't understand why my correct code was erroring with a syntax error until google came up with the eslint blog post which mentions Aside: Some of the other 'correct' options are beginning to look a bit like line noise (and this from a perl programmer). Could almost do with a complexity/obfuscated warning. |
@aavmurphy Thanks, we've already decided against adding that for the reasons already stated. If you have other feedback for the documentation, can you open a separate issue? It will make it easier for us to track. Thanks! |
@mdjermanovic can this be closed now? It looks like the PR was merged but didn't have a "fixes" tag. |
Yes, the accepted documentation update has been merged (we had "refs" instead of "fixes" probably because the PR addresses only part of this request). |
The version of ESLint you are using.
7.18.0 (n/a- website doco)
The problem you want to solve.
The no-unsafe-option-chaining rule page ( https://eslint.org/docs/rules/no-unsafe-optional-chaining ) should mention you also need :
parserOptions.ecmaVersion: 2020
(as mentioned here https://eslint.org/blog/2020/07/eslint-v7.5.0-released )
And while you're there, please add to correct examples a simple
obj.foo?.bar
Your take on the correct solution to problem.
Are you willing to submit a pull request to implement this change?
The text was updated successfully, but these errors were encountered: