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
no-undef misleading example #11963
no-undef misleading example #11963
Comments
Hi @mdjermanovic, thanks for the issue. I think |
The interesting thing here is that /* eslint no-implicit-globals:"error" */
/* eslint no-global-assign:"error" */
/* global a:readonly */
a = 1;
None of the rules will report anything if the global variable is set to Is this the intended behavior of |
I guess that it's intended because there are tests. But it sounds a bug to me. In the original issue #4542, they talked about declarations. |
The version of ESLint you are using.
master
The problem you want to solve.
From
no-undef
docs:'Incorrect' examples should be those with warnings, but ESLint does not report any warnings for the second example.
The problem with this is that the second example is actually correct, because
no-undef
rule does not check assignments to readonly global variables, that's whatno-global-assign
does.Your take on the correct solution to problem.
I'm not sure. Probably modify the first example and remove the second. Maybe reference
no-global-assign
. Perhaps also add more info tono-global-assign
.Are you willing to submit a pull request to implement this change?
Yes.
The text was updated successfully, but these errors were encountered: