Given a project structure as follows:
main
∟ dir1
∟ component-a.ts
∟ component-a.spec.ts
∟ component-b.ts
∟ component-b.spec.ts
∟ dir2
∟ component-c.ts
∟ component-c.spec.ts
∟ dir3
∟ subdir
∟ component-d.ts
∟ component-d.spec.ts
How can I exclude all spec
files except the ones in main/dir3/
?
By excluding the *.spec.ts
pattern, I am unable to re-include the inner directory then unless I create an .eslintrc.json
file inside it, but I would like not to have to duplicate the whole ruleset.
I've also tried changing the exclusion pattern to something like **/!(dir3)/**/*.spec.ts
, but that doesn't seem to work.
My current config is as follows:
{
"root": true,
"ignorePatterns": [...],
...
"overrides": [
{
"files": ["*.ts"],
"excludedFiles": [
"*.spec.ts"
],
"rules": {...}
}
]
}