if config appears in project folder, configs in home directory can't be seen totally
See original GitHub issueTell us about your environment Linux version 3.6.32-431.11.2.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Tue Mar 25 19:59:55 UTC 2014
-
ESLint Version: v3.11.1
-
Node Version: v7.2.0
-
npm Version: 3.10.9 What parser (default, Babel-ESLint, etc.) are you using? espree Please show your full configuration:
in .eslintrc in ~/:
{
"env":{
"browser":true
,"node":true
,"es6":true
}
,"extends":"eslint:recommended"
}
-----------------------------------------------------------------------------------------------
the next cause problem(if removed works as expected):
-----------------------------------------------------------------------------------------------
in project directory:
either place the following in package.json:
eslintConfig:{}
or file .eslintrc with following content exists
{}
What did you do? Please include the actual source code causing the issue.
in app.js
const a=1;
What did you expect to happen? config cascading and hierarchy take effect.
run: eslint --print-config app.js long config list shows, with the same content with when no empty config appears in project folder;
run: eslint app.js error ‘a’ is assigned a value but never used no-unused-vars
What actually happened? Please include the actual, raw output from ESLint. run: eslint --print-config app.js { “globals”: {}, “env”: {}, “rules”: {}, “parserOptions”: {} }
run: eslint app.js error Parsing error: The keyword ‘const’ is reserved
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (10 by maintainers)
I think the current behavior is correct. the home directory is a special case because it can unintentionally affect a lot of projects (iirc this was an early complaint). I think changing that now would be confusing and possibly damaging to the current user base.
I’m all for updating the docs to make this special case clearer.
@ljharb I believe the accepted resolution here is to update the docs to make it clear that the home directory is a special case. I agree with others that this is too big a breaking change to introduce now.