-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
eslint ignores variables named status
#1834
Comments
As I understand it is expected behavior since |
It's still confusing and IMO we should forbid implicit |
I think eslint doesn't support that. |
I don't mind having our own list of globals. |
I can work on this. |
Sounds good! |
see #1840 |
I think I was wrong about this. People are genuinely confused when “valid” globals don’t work—especially if they’re built into the browser. I propose another strategy. Let’s go through the list of globals and pick a list of names that can genuinely be confused with local variables (e.g. |
Fixed by #2130 with an explicit blacklist. |
Please help beta test the new version that includes this change! |
Can you reproduce the problem with latest npm?
yes. npm version: 4.1.1
Description
Linter ignores
status
variable name when checking for unused vars.Not sure if this is a bug or expected behaviour.
Expected behavior
It should probably warn when I have not declared a variable named
status
and have this line of code:console.log(status)
Actual behavior
Even though I have not declared any variable named
status
,using it does not show any warning or errors.
it shows
no-undef
error on all other variables names likestatuss
as expectedEnvironment
Run these commands in the project folder and fill in their results:
npm ls react-scripts
(if you haven’t ejected): 0.9.0node -v
: v7.7.1npm -v
: 4.4.1Then, specify:
Reproducible Demo
create a new app with:
create-react-app test-app
In index.js type:
console.log(status)
It won't show any error that status is not defined but changing the variable name to
statuss
would show error as expectedThe text was updated successfully, but these errors were encountered: