kaelzhang / node-ignore

🔍 node-ignore is the manager and filter for .gitignore rules, the one used by eslint, prettier and many others.
Other
439 stars 45 forks source link

Options merge #107

Open coderaiser opened 11 months ago

coderaiser commented 11 months ago

Would be great to have ability to merge options, so if I have:

tmp
**/coverage
!**/coverage

It was merged to:

tmp

Is it possible?

kaelzhang commented 11 months ago

I can't understand your question. could you provide minimum slices of code and the expected result?

coderaiser commented 11 months ago

Sure https://github.com/coderaiser/putout/commit/4a83bb83f611802a78c3ff51cd6b19dea8c0fbd8

kaelzhang commented 11 months ago

Is it for performance purposes?

But why do we write such a silly ignore rule set as ['**/coverage', '!**/coverage']?

coderaiser commented 11 months ago

Good question! There is default ignore rules in putout.json which says to ignore coverage directory. And user can create it's own .putout.json file, and would be great if he can override it changes.

I need it because I have a big monorepo, with a lot of coverage directories in each module, but I don't really need it, so I write a rule do remove them, so I need to override default change.

Also someone can have it's own preferences about things that should be ignored, and ability to override defaults is always good to have.