question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.eslintrc is incorrectly resolved from within another .eslintrc file

See original GitHub issue

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)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
SeanSobeySagecommented, Jun 20, 2016

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 );

0reactions
vitorbalcommented, Jun 20, 2016

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use file location for `.eslintrc.js` resolution · Issue #712
js This can happen for a couple of reasons: 1. The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc)....
Read more >
eslint working with the .eslintrc.js and not ...
It looks like you have an ESLint configuration file in the Project folder, which is up the directory structure of your actual project...
Read more >
parserOptions.project eslint path is resolved wrong
I am using a project generated by @nrwl/nx and they are working with eslint config file extension a lot. Sub projects have new...
Read more >
eslint/eslint - Gitter
I have an .eslintrc.json file in the root directory of the project. ... The problem is that eslint fails to resolve the plugins,...
Read more >
Setting up efficient workflows with ESLint, Prettier and ...
It is useful if the README.md is incomplete or incorrect. Basically you can say that "plugins" point to a single file where the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found