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
Rule Change: no-implicit-globals should not report exported #16327
Comments
Makes sense to me 👍 I think the main purpose of this rule is to prevent accidental creation of global variables. Declaring |
Makes sense to me. Should this be a bug rather than an enhancement? |
Can I work on this? |
Yes please :-) |
I think this was an oversight in the design because the |
Just to clarify: you’re saying this is an enhancement because the rule intentionally didn’t consider this behavior? |
No, I think he means it's a bug, because it was forgotten to consider |
Sorry for the confusion. Supporting Either way, I think we can treat this as a bug fix. However, if this requires adding a new property on Variable objects (#16343 (comment)), then it seems more appropriate to mark the change as a |
Sounds good. |
What rule do you want to change?
no-implicit-globals
What change to do you want to make?
Implement suggestions
How do you think the change should be implemented?
A new default behavior
Example code
What does the rule currently do for this code?
When using with lexicalBindings
/*eslint no-implicit-globals: ["error", {"lexicalBindings": true}]*/
it gives an errorWhat will the rule do after it's changed?
Not report an error, if the variable/function is "exported"
Additional comments
This was already requested previously but closed due to age #10066
Essentially it should have the same behavior as rule
no-unused-vars
, where exported variables/functions don't count as unusedThe text was updated successfully, but these errors were encountered: