pathGroups using minimatch instead of real regexes
See original GitHub issueThe new pathGroup addition is using minimatch
, this being based on shell glob expansions makes it incredible hard to do differing matching on paths containing ../
updots, as these are not easily (if at all) added to the minimatch expression in unspecified depth.
Yes, the codebase should import from the roots and not jump up arbitrarily, but sometimes the world is at it is.
This shortcoming is not evident inside the PR tests themselves, as all these prefix with special characters: https://github.com/benmosher/eslint-plugin-import/pull/1386/files
I didn’t find a way to express my wanted regex with minimatch, it would be great to have a shortcutting flag to just supply a real regex.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:27 (12 by maintainers)
Top Results From Across the Web
pathGroups using minimatch instead of real regexes #1632
The new pathGroup addition is using minimatch, this being based on shell glob expansions makes it incredible hard to do differing matching ...
Read more >ESLint plugin import not sorting properly - Stack Overflow
Okay, I solved this. The problem was that eslint couldn't resolve typescript aliases and that's why it sorts imports randomly, ...
Read more >Regular Expression Denial of Service (ReDoS) in minimatch
minimatch is a minimal matching utility. Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) ...
Read more >eslint-plugin-import | Yarn - Package Manager
This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names.
Read more >Understanding AS Path Regular Expressions for Use as ...
When working with AS paths and routing policy match conditions, you can use regular expressions to locate routes. To do so, create one...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not interested in a regex approach; I’d rather fix the way we’re using minimatch.
In other words, I’d expect you to be able to use globs - multiple globs in an array if possible - to achieve what you want, and if you can’t right now, let’s make that happen.
Pretty sure it doesn’t: