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
Breaking: make no-redeclare stricter (fixes #11370, fixes #11405) #11509
Conversation
- Implement eslint/rfcs#17 - Fixes #11370 - Remvoes the access to parserOptions from no-redeclare rule - Adds several tests for lexical bindings to no-redeclare rule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! I haven't gone through the implementation thoroughly yet, but I left a few suggestions.
Co-Authored-By: mysticatea <star.ctor@gmail.com>
# Conflicts: # tests/lib/rules/no-redeclare.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few small suggestions.
I'm a little leery about consuming acorn in ESLint, but there's probably not much choice here. Part of me wonders if we should expose a loose parsing mode in espree and just use that, but maybe that would just be a support headache as people ask us about issues involving loose espree...
Co-Authored-By: mysticatea <star.ctor@gmail.com>
Co-Authored-By: mysticatea <star.ctor@gmail.com>
# Conflicts: # lib/config/config-ops.js # lib/linter.js # tests/lib/config/config-ops.js
I'm not sure when I'll have time to review this thoroughly, but my previous review has been addressed.
# Conflicts: # package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! Sorry for the delay.
Thank you very much! |
What is the purpose of this pull request? (put an "X" next to item)
[X] Changes an existing rule
[X] Add something to the core
What changes did you make? (Give an overview)
This PR makes
no-redeclare
rule stricter./*globals*/
comment check tono-redeclare
rule. (Proposal: no-redeclare reports /*globals foo*/ comments if it's redeclaration #11370){ builtinGlobals: true }
option by default. (Proposal: change no-redeclare default behavior #11405)Adds some items to the migration guide.(moved to Docs: add v6.0.0 migration guide #11515)And some chore:
parserOptions
fromno-redeclare
rule. TheparserOptions
is not safe because each parser has different options./*globals*/
comments toast-utils
because it's shared withno-unused-vars
rule andno-redeclare
rule.no-redeclare
rule along with a loose parser that doesn't throw syntax errors on redeclaration of lexical bindings.Makes(moved to Chore: make test-case-property-ordering reasonable #11511)eslint-plugin/test-case-property-ordering
rule's option more reasonable.Is there anything you'd like reviewers to focus on?
no-redeclare
rule handle lexical bindings still? Since acorn 5.0.0, it throws syntax errors by such a redeclaration.