I have multiple overrides that target different file subsets, but some overlap.
But eslint only seems to use the last matched override, thereby ignoring some of my rules.
I have the following config:
{
"root": true,
"overrides": [
...
{
"files": [
"**/app/**/*.ts"
],
"rules": {
"no-restricted-imports": ["error", {
"patterns": [{
"group": ["*/platform-browser"],
"message": "Bar"
}]
}]
}
},
{
"files": [
"**/src/**/*.ts"
],
"rules": {
"no-restricted-imports": ["error", {
"patterns": [{
"group": ["*/core"],
"message": "Foo"
}]
}]
}
},
...
]
}
Then I have the file src\app\app.module.ts:
import { NgModule } from '@angular/core'; //<-- Should trigger Foo
import { BrowserModule } from '@angular/platform-browser'; //<-- Should trigger Bar
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
But it only triggers one of the rules (the one that's last in the override array)
Is there someway to apply both?
I have a sample repository here if that helps