-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrectly matches trailing negation (e.g. to match .ts
but not .d.ts
with **/!(*.d).ts
)
#83
Comments
I think I know what's causing it, but I'll double check with the sandbox, thanks for doing that! edit: in your code snippet here, you are using micromatch in the The pattern |
fwiw I'm still playing around with the sandbox, I think that there might be a bug here. I'll report back when I'm finished looking into it. |
@jonschlinkert Oops, incorrectly edited the example to make it more readable. I've cleaned it up now, the results are the same though (minimatch shows one result, picomatch and micromatch another). Incredibly fast response, thanks a lot 🙌 |
Exactly, out of the paths in the example only |
Thanks for a great library and apologies in advance if this has been adressed somewhere else! 🙏
Issue
I'm trying to match a pattern that matches all
*.ts
files except*.d.ts
, and while it works most of the time it does not seem to work if whatever pattern you're negating is used anywhere else in the path.The glob
**/!(*.d).ts
should work for this case, but with picomatch and micromatch it excludes any file name that contains.d
at all, not just at the end. With minimatch and other globbing tools it works as expected.Example
I also created a CodeSandbox with an example for testing any glob (see the console output).
The text was updated successfully, but these errors were encountered: