-
-
Notifications
You must be signed in to change notification settings - Fork 252
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
"**/" pattern doesn't match "./" path part #30
Comments
This may be related to an issue i am having trying to match a file in a hidden dir. minimatch("/Users/corban/.go/src/app.js", "**/app.js") // false |
@corbanbrook I had a similar issue - #51 - and solved it by passing minimatch("/Users/corban/.go/src/app.js", "**/app.js", {dot: true}) // true This doesn't fix @cowboy's case though: minimatch("./foo/bar.js", "**/foo/**", {dot: true}) // false |
So, why don't we fix this? This also breaks such packages as gulp-filter functionality, also with patterns containing "../", what is sometimes quite essential. |
+1. It would really be nice if minimatch supported |
👍 Actually hidden files NEVER match :
I tested this behaviour with minimatch v0.3.0, v2.0.7 & v3.0.2 |
And yes, this affects any file with a directory starting with a dot anywhere in its full path. I think this is a major issue. |
Please disregard my previous comments: I found out about I think this really shoud be the default behaviour though. |
CSS concatenation doesn't work with gulp-filter version 4.0, due to some problems with path resolution, that comes from minimatch - sindresorhus/gulp-filter#67 - isaacs/minimatch#30
Agree this should be default behaviour- if there's a directory named Or is it a standard shell feature to ignore hidden folders, and that's the API you'd prefer to mirror? I can understand that, too. |
I know this is an old issue, but I manage to fix my problem with |
For anyone struggling with @diogolessa’s solution, use |
Paths starting with This is by design, and matches the behavior of bash 4.3+. |
I'm new to minimatch and I'm struggling exactly with this. By reading the last comment it seems there is no valid pattern to match a portion of a path when dots are present unless I specify all the possible combinations, right? |
As stated back in February, If you are receiving paths that may contain |
Thank you for your answer. I'm using eslint import plugin, specifically the order rule that allows you to define your own path groups and the pattern option uses minimatch. By reading your last comment it looks like minimatch is not the right solution here since there is no way I can predict all the possible patterns an import could have. It depends on whether you are importing a module from, so it might or might not have a dot or .. at the beginning. I will try the dot option and see how far I can get with that. Thank you again for your answer,there is nothing wrong with minimatch, I just wanted to provide more context about my use case. |
@kimurakenshi the import plugin has another rule that requires a normalized path; i suggest using that as well. |
Thank you, I wasn't aware of that rule, I will check that out then. I appreciate the help on this. |
@ljharb do you happen to remember which rule exactly requires normalizes paths in eslint-import? I tried https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md but I don't think that is the one. |
https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md If you have further questions, please file them on eslint-plugin-import so we don't create more noise here. |
This seems like a bug to me, intuitively, but I don't see it addressed in the docs anywhere:
Shouldn't the last example return
true
because**/
should match./
?Ref. cowboy/node-globule#11
The text was updated successfully, but these errors were encountered: