eslint: Regression from 2.13.0 release - relative requires in extend

Ref https://github.com/eslint/eslint/pull/6359 I think, @mysticatea

What version of ESLint are you using?

2.13.0 (just released)

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

default

Please show your full configuration:

{
  "extends": "./node_modules/eslint-preset-behance/.eslintrc"
}

What did you do? Please include the actual source code causing the issue.

run eslint app_folder/

Updated to 2.13.0 in CI

What did you expect to happen?

No issues

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

Cannot read config file: app/node_modules/node_modules/eslint-preset-behance/.eslintrc
Error: ENOENT: no such file or directory, open 'app/node_modules/node_modules/eslint-preset-behance/.eslintrc'

It’s checking node_modules/node_modules for some reason

Workaround I guess is that we don’t have to use ./node_modules/

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 7
  • Comments: 20 (16 by maintainers)

Commits related to this issue

Most upvoted comments

I apologize for this. I will investigate this. I think relativeTo should be the directory that .eslintrc exists.

Same here. It broke all our builds

I think I figured it out. See https://github.com/eslint/eslint/pull/6468

@ljharb We are usually try to release patches on the following Monday after the release that created an issue.

@mysticatea Another problem related to this change. You can’t run global eslint at all anymore:

$ eslint .
Cannot read config file: C:\Users\ilya\AppData\Roaming\npm\node_modules\packages\eslint-config-eslint\default.yml
Error: ENOENT: no such file or directory, open 'C:\Users\ilya\AppData\Roaming\npm\node_modules\packages\eslint-config-eslint\default.yml'
Referenced from: c:\Users\ilya\Documents\github\eslint\.eslintrc.yml
Error: Cannot read config file: C:\Users\ilya\AppData\Roaming\npm\node_modules\packages\eslint-config-eslint\default.yml
Error: ENOENT: no such file or directory, open 'C:\Users\ilya\AppData\Roaming\npm\node_modules\packages\eslint-config-eslint\default.yml'
Referenced from: c:\Users\ilya\Documents\github\eslint\.eslintrc.yml
    at Error (native)
    at Object.fs.openSync (fs.js:549:18)
    at Object.fs.readFileSync (fs.js:397:15)
    at readFile (C:\Users\ilya\AppData\Roaming\npm\node_modules\eslint\lib\config\config-file.js:71:15)
    at loadYAMLConfigFile (C:\Users\ilya\AppData\Roaming\npm\node_modules\eslint\lib\config\config-file.js:102:30)
    at loadConfigFile (C:\Users\ilya\AppData\Roaming\npm\node_modules\eslint\lib\config\config-file.js:219:22)
    at load (C:\Users\ilya\AppData\Roaming\npm\node_modules\eslint\lib\config\config-file.js:500:18)
    at C:\Users\ilya\AppData\Roaming\npm\node_modules\eslint\lib\config\config-file.js:392:36
    at Array.reduceRight (native)
    at applyExtends (C:\Users\ilya\AppData\Roaming\npm\node_modules\eslint\lib\config\config-file.js:363:28)

It’s looking for C:\Users\ilya\AppData\Roaming\npm\node_modules\packages\eslint-config-eslint\default.yml and correct path should be C:\Users\ilya\AppData\Roaming\npm\node_modules\eslint\packages\eslint-config-eslint\default.yml So it’s going one directory too far up.

Is there a deadline at which point the change that broke this will be reverted, absent a fix?

Let’s see what @mysticatea thinks. He should be around soonish and then we can decide whether there’s an easy fix or not.