Use a different shareable config for eslint in a subfolder of a project
Asked Answered
C

1

6

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?

Cyte answered 5/11, 2017 at 13:8 Comment(0)
S
10

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.

Sisterly answered 6/11, 2017 at 22:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.