Reputation: 1397
Can I split the ESLint rules by glob pattern?
I mean case like this:
{
"*.server.js": { /* rules set for the server JS */ },
"*.client.js": { /* rules set for the client JS */ },
"*.special.js": { /* some very special JS */ },
"*.js": { /* all other JS with its own rules not intersecting with others */ }
}
There is the jshint-groups wrapper for JSHint. Is there something like this for ESLint?
Upvotes: 1
Views: 929
Reputation: 6647
This is now possible using an overrides section:
{
"rules": {...},
"overrides": [
{
"files": ["*-test.js","*.spec.js"],
"rules": {
"no-unused-expressions": "off"
}
}
]
}
https://eslint.org/docs/user-guide/configuring/rules#using-configuration-files-1
Upvotes: 1
Reputation: 11266
Not yet. It's one of the items on the road map for version 2.0.0. For now if you are using grunt/gulp, you can just create multiple tasks with multiple .eslintrc files.
Upvotes: 2