-
Notifications
You must be signed in to change notification settings - Fork 26.7k
no-unused-vars rule don't work while extending the airbnb's config #773
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
Comments
According to the eslint docs, setting the "vars" option should still warn about unused local vars - it seems that error is correct, and that var is unused, meaning that line could be deleted and your program would work the same. |
( I'm referring both to https://github.com/artptr/eslint-airbnb-no-unused-vars-bug/blob/master/.eslint-project-rules.json#L3 and to the redundant https://github.com/artptr/eslint-airbnb-no-unused-vars-bug/blob/master/.eslintrc.json#L8 ) btw thanks for the reproduction repo, that makes it super easy to understand what's going on! |
@ljharb Foo is the global variable, not local. |
Every file in node is in a module context, which means it's not at all a global variable. |
@vkrol you can verify that by checking |
So the |
@artptr it's for both. but |
@ljharb but if we remove the |
Also it may be returned to assumed behavior by adding
|
Right - this isn't a bug, because in 2016 everything should be run in a node context, and only after running through browserify/webpack should it be shipped to a browser. You're certainly free to override the env settings in your eslint config, however! |
This repo reproduces the bug in
eslint-config-airbnb
.There is an error while checking the
test.js
:The error appears despite that the parent config contains appropriate
no-unused-vars
setting.It disappears only if we remove the airbnb's config (default or legacy) from the
extends
property.The error appears on the ESLint 1.10.3 and 2.2.0
The text was updated successfully, but these errors were encountered: