c8 icon indicating copy to clipboard operation
c8 copied to clipboard

Extend default exclusion patterns?

Open EnderShadow8 opened this issue 4 years ago • 2 comments

When using --exclude, the argument passed overrides the default exclusions. What I want to do is to extend the defaults, so I don't have to specify them manually.

Is there a way to do this?

EnderShadow8 avatar Jun 12 '21 09:06 EnderShadow8

I don't know if there is a way to do this today, but this sounds like a good feature request. We should look at nyc, which c8 is based on, and see if they figured out a way to support this.

bcoe avatar Jul 10 '21 14:07 bcoe

I came upon this issue looking to do the same thing, the nyc documentation mentions that exclude patterns can be negated by prefixing with !, but it seems to work for include as well.

In my case it was sufficient to add a negated path to the include array like so:

{
  "include": ["**/*.ts", "**/*.tsx", "!**/*.stub.ts"]
}

vbabel avatar Jan 27 '22 22:01 vbabel