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
Fix no files matching the pattern error square brackets and dash #4855
Comments
@reumia Thanks for the report and for using the template. I've added this issue to #4521, which is a list of the problems with globs and paths that we need help to fix. I've labelled this issue as ready to implement. Please consider contributing if you have time. |
Hey @reumia, thanks for reporting this issue. Could you create a small example that reproduces the problem? As I couldn't get one of your success cases to work. For me, these are the failure cases:
These all fail for the same reason. They're globs mixed with directory paths that contain special characters. These special characters are valid globbing characters and valid directory names. There's no simple way for stylelint to know which part of the string is a path, and which part is a glob. In your examples the Workarounds There are a few ways you can work around this:
|
You can use https://github.com/mrmlnc/fast-glob#escapepathpattern to avoid this problem, before passing it to globby, but it can be small breaking change |
This is what happens in #4867 (code link), but it won't fix for patterns like this:
As it will escape the whole path, leaving you with a path that doesn't match anything:
|
@evilebottnawi I've tested this already, and it won't work with same reason above. |
Maybe the last solution would be work for me. Next.js growing up fast in recently, so i hope stylelint support this issue. thx. |
@reumia I think the first workaround should handle this? It's also one of the success cases that you originally described. e.g. with the following directory structure:
This should lint all four files:
I'm not so familiar with |
If you are using the Webpack plugin - here is a patch for this issue which can be applied through custompatch
|
Succeed cases
Failure cases
13.3.3
Usually i run stylelint with lint-staged like below,
but i tested it common usage like i wrote in top of this document, and i got same result.
Following error happened.
The text was updated successfully, but these errors were encountered: