Open gdlol opened 9 months ago
@gdlol,
Thank you for pointing out the exact issue.
I'll take another look at ignore
. It previously wasn't suitable for a couple of reasons:
.gitignore
rejected the file.node:fs
, make it impossible to use a virtual fs.In any case, I think the current implementation of GlobMather needs to be improved.
@gdlol,
I was wrong in my comments above, node-ignore is not the package I had earlier evaluated. Thank you for the pointer.
Info
Which Version
Version: 8.2.1
Issue with supporting library?
Bug Description
Describe the bug
When using the
useGitignore
option, patterns in.gitignore
seems not being processed in order. The issue seems to be that in this line where positive rules and negative rules are handled separately, hence not handling scenarios like ignore-then-unignore/unignore-then-ignore correctly according to Git behavior.To Reproduce A minimal script to reproduce the bug:
package.json
index.js
Output (
node index.js
):By the way, please check the ignore package which should be more suitable for handling gitignore patterns than
micromatch
used incspell-glob
.