Skip to content
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

.eslintrc is incorrectly resolved from within another .eslintrc file #6479

Closed
remcohaszing opened this issue Jun 20, 2016 · 5 comments
Closed
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon

Comments

@remcohaszing
Copy link
Contributor

What version of ESLint are you using?
2.13.0

What parser (default, Babel-ESLint, etc.) are you using?
None

Please show your full configuration:
The following directory tree:

|- src/
|   `- .eslintrc
`-  website/
     ` app/
        ` .eslintrc

What did you do? Please include the actual source code causing the issue.
website/app/.eslintrc contains the following:

extends: ../../src/.eslintrc

What did you expect to happen?
website/app/.eslintrc to extend src/.eslintrc. This does work when using eslint@2.12.0.

A workaround is to incorrectly remove one ../ from the path.

What actually happened? Please include the actual, raw output from ESLint.

/home/remco/d-centralize/appsemble/node_modules/eslint/lib/config/config-file.js:402
            throw e;
            ^

Error: Cannot read config file: /home/remco/d-centralize/src/.eslintrc
Error: ENOENT: no such file or directory, open '/home/remco/d-centralize/src/.eslintrc'
Referenced from: /home/remco/d-centralize/appsemble/website/app/.eslintrc
    at Error (native)
    at Object.fs.openSync (fs.js:634:18)
    at Object.fs.readFileSync (fs.js:502:33)
    at readFile (/home/remco/d-centralize/appsemble/node_modules/eslint/lib/config/config-file.js:71:15)
    at loadLegacyConfigFile (/home/remco/d-centralize/appsemble/node_modules/eslint/lib/config/config-file.js:143:44)
    at loadConfigFile (/home/remco/d-centralize/appsemble/node_modules/eslint/lib/config/config-file.js:223:22)
    at load (/home/remco/d-centralize/appsemble/node_modules/eslint/lib/config/config-file.js:500:18)
    at /home/remco/d-centralize/appsemble/node_modules/eslint/lib/config/config-file.js:392:36
    at Array.reduceRight (native)
    at applyExtends (/home/remco/d-centralize/appsemble/node_modules/eslint/lib/config/config-file.js:363:28)
    at Object.load (/home/remco/d-centralize/appsemble/node_modules/eslint/lib/config/config-file.js:531:22)
    at loadConfig (/home/remco/d-centralize/appsemble/node_modules/eslint/lib/config.js:64:33)
    at getLocalConfig (/home/remco/d-centralize/appsemble/node_modules/eslint/lib/config.js:126:23)
    at Config.getConfig (/home/remco/d-centralize/appsemble/node_modules/eslint/lib/config.js:227:22)
    at processText (/home/remco/d-centralize/appsemble/node_modules/eslint/lib/cli-engine.js:223:27)
    at CLIEngine.executeOnText (/home/remco/d-centralize/appsemble/node_modules/eslint/lib/cli-engine.js:761:26)
@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Jun 20, 2016
@SeanSobeySage
Copy link

Getting this same issue, seems related to the updates in config-file.js method applyExtends(config, filePath, relativeTo);. Specifically line 384:
parentPath = (!isAbsolutePath(parentPath) ? path.join(relativeTo || path.dirname(filePath), parentPath) : parentPath );

@kokarn
Copy link
Contributor

kokarn commented Jun 20, 2016

This breaks with this as well with the same error.

"extends": "./default.eslintrc",

@kokarn
Copy link
Contributor

kokarn commented Jun 20, 2016

Confirmed it's this commit that breaks fb49c7f from pull #6359

Parent works

npm install git://github.com/eslint/eslint.git#5122f738dc6bdc85c602758b2fa3560c1ac5dceb

Commit that breaks

npm install git://github.com/eslint/eslint.git#fb49c7fb119c6d2a2a0441a01190bda8a9172353

@kokarn
Copy link
Contributor

kokarn commented Jun 20, 2016

Also, this is a duplicate of #6482 so this can be closed ^^

@vitorbal
Copy link
Member

Closing this as it is a duplicate of #6450. There should be a patch release today with the fix. Follow #6450 for updates!

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

5 participants