idok / eslint-plugin

ESLint plugin for intellij
http://plugins.jetbrains.com/plugin/7494
MIT License
151 stars 18 forks source link

Working directory isn't set on the root directory with multiple eslintrc files #91

Open alatimier opened 3 years ago

alatimier commented 3 years ago

In a project with multiple eslintrc files, the eslint working directory is set on the closest eslintrc file directory instead of the root eslintrc file directory.

For exemple with this project structure :

app/
  .eslintrc.json
  test/
      .eslintrc.json
      my-test.spec.js

ESLint working directory is the 'test' directory instead of 'app' and paths in parent configuration are then broken :

"import/no-extraneous-dependencies": ["error", {
    "devDependencies": [
        "test/**/*.js"
    ]
}],

This results in having extra warnings in the IDE that should not be there.

Quick fix is to manually set the working directory on the app directory but having to change it for every project is cumbersome. Especially in a lambda environnement where we have many projects.

Thanks for the consideration. Regards