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 overrides.files
negated pattern regression
#7056
Comments
I guess it's just a matter of doing a |
overrides.files
negated pattern regression
@emmasax Thanks for the detailed report and for using the template. I can reproduce this locally with: {
"rules": {
"color-no-invalid-hex": null
},
"overrides": [
{
"files": ["!(*/**/test.css)"],
"rules": {
"color-no-invalid-hex": true
}
}
]
} /* /test/test.css */
a {
color: #00;
}
I've labelled the issue as ready to implement. Please consider contributing if you have time. It may require a bit of digging, though. |
Sorry for the late response. As @Mouvedia guessed, I produced this bug through PR #6547. The bug is at: stylelint/lib/augmentConfig.mjs Lines 394 to 398 in d881c9d
Here's a simple confirmation. Returning micromatch = require('micromatch');
micromatch.isMatch('/foo/test.css', ['!(**/test.css)'], { dot: true, basename: true });
//=> true I'll create a patch pull request soon. However, this glob's syntax/behavior depends on a glob library (currently {
- files: ['!(**/test.css)'],
+ files: ['**/*.css'],
+ ignoreFiles: ['**/test.css'],
} |
What minimal example or steps are needed to reproduce the bug?
Create file
fontSizeAllowedFile.tsx
:What minimal configuration is needed to reproduce the bug?
Using glob pattern to exclude files (
!(files)
) does not work in Stylelint 15. It does work in previous versions.Using the positive glob does include only this file
["*/**/fontSizeAllowedFile.tsx"]
, just negating it does not work.How did you run Stylelint?
Via nx stylelint command
Which Stylelint-related dependencies are you using?
What did you expect to happen?
File should not run disallowed list on the excluded file.
What actually happened?
File is not excluded
Do you have a proposal to fix the bug?
No response
The text was updated successfully, but these errors were encountered: