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
Remove deprecated key 'root' from node's env #9144
Comments
Unfortunately, ESLint can't make any assumptions about which version of Node someone is using. This is the package we use: https://github.com/sindresorhus/globals/blob/master/globals.json#L867 There are third party plugins such as https://www.npmjs.com/package/eslint-plugin-node that will actually do feature-checking based on the Node version, and something like that could be a good place for a feature like this. Alternatively, are you suggesting that ESLint should be enhanced to allow specification of the target Node version? That's an interesting thought, though it's not a trivial thing to implement. |
It seems that this issue should be moved to https://github.com/sindresorhus/globals. I understand those platform-specified rules should be handled by plugins. However, I don't know if env global is in this case. Are those globals maintained by ESLint team? For example, Greasemonkey is working on version 4.0 which might add/remove some globals too (greasemonkey/greasemonkey#2484). BTW, https://github.com/mysticatea/eslint-plugin-node looks good. I'll definitely try it. |
NVM, I saw that those are located in globals.json. |
@eight04 By the way, you could use |
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
Configuration
eslint --no-eslintrc --env es6,node --rule "no-undef: 2" test.js
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
What actually happened? Please include the actual, raw output from ESLint.
Nothing is reported, because
root
is a global variable in node env.However, global
root
is a deprecated feature. By removingroot
from node's env, it should help those developers that accidentally access globalroot
variable.The text was updated successfully, but these errors were encountered: