Use a different shareable config for eslint in a subfolder of a project

Viewed 4010

I have a node 8 project in ES6, that also contains some client-side code in ES5. I'm linting the node code with eslint and using airbnb-base for it.

However, the client-side code is ES5, so I want to use airbnb-base/legacy for it. The problem is that the ES5 client-side code is in a subfolder of the project, which automatically inherits the main eslint configuration (so also the extends: ["airbnb-base"].

Is there a way to specify extends: ["airbnb-base/legacy"] for folder below the main config, and not inherit airbnb-base?

1 Answers

If you specify root: true in your subfolder's .eslintrc.js, then you can can then extends: ["airbnb-base/legacy"], and it won't inherit any config from the parent directory.

Related