-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
Can't match string with leading dot #217
Comments
Try passing a custom const micromatch = require('micromatch');
const format = input => input.replace(/^\.\//, '');
console.log(micromatch.isMatch('./my/relative/file.js', 'my/*/file.js', { format })); //=> true
console.log(micromatch.isMatch('./my/relative/file.js', './my/*/file.js', { format })); //=> true
console.log(micromatch.isMatch('./my/relative/file.js', '**/my/*/file.js', { format })); //=> true The issue of leading dot slashes has been discussed a few times on this and related repositories. Since Related: Please let me know if this helps. |
Thanks for the reply. Feel free to close this if this indeed works as intended. Though it would be helpful to mention this in the README so other people won't have to run into debugging this issue. |
This is awful DX |
(Thanks for reporting an issue to micromatch! If you haven't already read the contributor guidelines, Please do that now, then proceed to fill out the details below.)
It seems that a leading dot prevents a glob from matching. For example,
./my/*/file.js
should match./my/relative/file.js
but it doesn't.Please describe the minimum necessary steps to reproduce this issue:
What is happening that shouldn't be?
Glob doesn't match string.
What should be happening instead?
Glob should match string. It works with minimatch and also globster.xyz.
The text was updated successfully, but these errors were encountered: