Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here is a problem I noticed:
!(node_modules)**/*.{png,ico}
doesn't match anything innode-glob-ignore
, but it does match when passed directly toglob
. (E.g. any png or ico file in a subdirectory in the current directly that's not inside of node_modules, and no deeper).This is due to this line dropping the glob:
node-glob-gitignore/src/util.js
Lines 83 to 88 in c8a236a
Now, I could pass in
./!(node_modules)**/*.{png,ico}
or**/!(node_modules)**/*.{png,ico}
(probably the more desirable glob) but that starts to diverge from globs that work inglob
.I know its better to use the ignore array here, but I'm trying to generally retain the same API of a tool that was formerly using glob.
I'm thinking that's a bug in the design of that function, but I'm curious what you think. Perhaps checking to make sure the negative glob isn't for a group, which would indicate that it is in fact a positively matching glob. That is the fix I added in this PR but looking for your thoughts on the solution.