eslint-plugin icon indicating copy to clipboard operation
eslint-plugin copied to clipboard

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

Open alatimier opened this issue 5 years ago • 0 comments

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

alatimier avatar Jan 04 '21 14:01 alatimier