I'm running eslint v1.8.0 against this test.js
file:
require('fs');
var a = 1;
At first, my .eslintrc
file is blank:
{
}
Running eslint test.js
returns:
1:1 error "require" is not defined no-undef
1:9 error Strings must use doublequote quotes
2:5 error "a" is defined but never used no-unused-vars
This is a node app, though, so I need to tweak it a bit. Running eslint --env node test.js
returns:
1:9 error Strings must use doublequote quotes
2:5 error "a" is defined but never used no-unused-vars
Perfect, that's exactly what I want. So I modify my .eslintrc
file to be:
{
"env": {
"node": true
}
}
When I run estlint test.js
file now, it returns nothing at all. Why does adding this to my .eslintrc
remove the quotes
and no-unused-vars
warnings?