-
-
Notifications
You must be signed in to change notification settings - Fork 989
Add regex support to ignoreAtRules option of at-rule-empty-line-before
#8385
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
Conversation
🦋 Changeset detectedLatest commit: 5fae210 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
||
| testRule({ | ||
| ruleName, | ||
| config: ['always', { ignoreAtRules: /^--my-/ }], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added simple tests for regex without string since string-wrapped regex tests already exist:
stylelint/lib/rules/at-rule-empty-line-before/__tests__/index.mjs
Lines 757 to 795 in aed00cd
| testRule({ | |
| ruleName, | |
| config: ['always', { ignoreAtRules: '/el/' }], | |
| fix: true, | |
| accept: [ | |
| { | |
| code: '@keyframes {}; @an-element-mixin();', | |
| }, | |
| { | |
| code: ` | |
| @if true {} | |
| @else { | |
| } | |
| `, | |
| }, | |
| ], | |
| reject: [ | |
| { | |
| code: ` | |
| @else { | |
| color: pink; | |
| } | |
| @if true {} | |
| `, | |
| fixed: ` | |
| @else { | |
| color: pink; | |
| } | |
| @if true {} | |
| `, | |
| message: messages.expected, | |
| line: 5, | |
| column: 7, | |
| }, | |
| ], | |
| }); |
Co-authored-by: Gary Gozlan <[email protected]>
ignoreAtRules:[] regex support in at-rule-empty-line-beforeignoreAtRules option of at-rule-empty-line-before
jeddy3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you.
| datasource | package | from | to | | ---------- | --------- | ------- | ------- | | npm | stylelint | 16.14.0 | 16.15.0 | ## [v16.15.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16150---2025-02-28) It adds 1 new rule, a `languageOptions` configuration property for configuring some of the new rules added in `16.13.0`, regex support to 1 option and support for computing `EditInfo` to 6 rules. It fixes 9 bugs, including 2 with the `tap` reporter. - Added: `syntax-string-no-invalid` rule ([#8331](stylelint/stylelint#8331)) ([@ryo-manba](https://github.com/ryo-manba)). - Added: `languageOptions` configuration property ([#8297](stylelint/stylelint#8297)) ([@ryo-manba](https://github.com/ryo-manba)). - Added: regex support to `ignoreAtRules` option of `at-rule-empty-line-before` ([#8385](stylelint/stylelint#8385)) ([@ryo-manba](https://github.com/ryo-manba)). - Added: `alpha-value-notation` support for computing `EditInfo` ([#8369](stylelint/stylelint#8369)) ([@pamelalozano16](https://github.com/pamelalozano16)). - Added: `color-hex-length` support for computing `EditInfo` ([#8415](stylelint/stylelint#8415)) ([@ryo-manba](https://github.com/ryo-manba)). - Added: `comment-empty-line-before` support for computing `EditInfo` ([#8416](stylelint/stylelint#8416)) ([@ryo-manba](https://github.com/ryo-manba)). - Added: `comment-whitespace-inside` support for computing `EditInfo` ([#8417](stylelint/stylelint#8417)) ([@ryo-manba](https://github.com/ryo-manba)). - Added: `custom-property-empty-line-before` support for computing `EditInfo` ([#8418](stylelint/stylelint#8418)) ([@ryo-manba](https://github.com/ryo-manba)). - Added: `declaration-block-no-duplicate-properties` support for computing `EditInfo` ([#8363](stylelint/stylelint#8363)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `tap` formatter not escaping `#` and `\` in its test point descriptions ([#8334](stylelint/stylelint#8334)) ([@Mouvedia](https://github.com/Mouvedia)). - Fixed: `tap` formatter outputting invalid YAML blocks for rules containing double quotes in their warnings' messages ([#8334](stylelint/stylelint#8334)) ([@Mouvedia](https://github.com/Mouvedia)). - Fixed: `declaration-block-no-redundant-longhand-properties` false positives for properties with `!important` ([#8366](stylelint/stylelint#8366)) ([@immitsu](https://github.com/immitsu)). - Fixed: `EditInfo` missing semicolon in `text` field ([#8370](stylelint/stylelint#8370)) ([@pamelalozano16](https://github.com/pamelalozano16)). - Fixed: `declaration-property-value-keyword-no-deprecated` false negatives for `text-decoration: blink` ([#8351](stylelint/stylelint#8351)) ([@Mouvedia](https://github.com/Mouvedia)). - Fixed: `declaration-property-value-keyword-no-deprecated` false positives for styled components interpolated functions ([#8392](stylelint/stylelint#8392)) ([@Mouvedia](https://github.com/Mouvedia)). - Fixed: `font-family-name-quotes` false positives due to vendor-prefixed font-size values ([#8393](stylelint/stylelint#8393)) ([@Mouvedia](https://github.com/Mouvedia)). - Fixed: `font-family-no-missing-generic-family-keyword` false positives for `math`, `emoji` and `fangsong` ([#8395](stylelint/stylelint#8395)) ([@ViachaslauIhnatsiuk](https://github.com/ViachaslauIhnatsiuk)). - Fixed: `selector-type-no-unknown` false positives for `selectmenu` and `popup` ([#8376](stylelint/stylelint#8376)) ([@Mouvedia](https://github.com/Mouvedia)). ## [v16.14.1](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16141---2025-01-27) It fixes a bug with caching. - Fixed: incompatible cache file format ([#8359](stylelint/stylelint#8359)) ([@romainmenke](https://github.com/romainmenke)).
Closes #8377
No, it's self-explanatory.