Skip to content

Commit

Permalink
Add warning on union class names #2217
Browse files Browse the repository at this point in the history
  • Loading branch information
onigoetz committed Dec 19, 2023
1 parent bf22b11 commit dfd3ca8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ Generated by [AVA](https://avajs.dev).
10:1 ✖ Expected ".notAComponent" to match pattern "/^(_)?(?:(?:u|t|(?:i|ha)?s)+-[a-z$]+[a-zA-Z0-9$()]*|(?:[a-z$][a-zA-Z0-9$()]+-)?[A-Z$][a-zA-Z0-9$()]*(__[a-z0-9$][a-zA-Z0-9$()]*)*(--[a-z0-9$][a-zA-Z0-9$()]*)*)$/" selector-class-pattern␊
15:1 ✖ A state must be linked to a component swissquote/no-state-without-component␊
20:1 ✖ Expected "#no-id" to have no more than 0 ID selectors selector-max-id␊
26:5 ⚠ Unexpected union class name with the parent selector (&) scss/selector-no-union-class-name␊
28:13 ✖ Expected nesting depth to be no more than 2 max-nesting-depth␊
31:6 ✖ Insert "⏎" prettier/prettier␊
8 problems (8 errors, 0 warnings)␊
9 problems (8 errors, 1 warning)␊
[__:__:__] 'css__lint' errored after ____ ms␊
[__:__:__] Failed with 8 errors␊
Expand Down Expand Up @@ -61,10 +62,11 @@ Generated by [AVA](https://avajs.dev).
10:1 ✖ Expected ".notAComponent" to match pattern "/^(_)?(?:(?:u|t|(?:i|ha)?s)+-[a-z$]+[a-zA-Z0-9$()]*|(?:[a-z$][a-zA-Z0-9$()]+-)?[A-Z$][a-zA-Z0-9$()]*(__[a-z0-9$][a-zA-Z0-9$()]*)*(--[a-z0-9$][a-zA-Z0-9$()]*)*)$/" selector-class-pattern␊
15:1 ✖ A state must be linked to a component swissquote/no-state-without-component␊
20:1 ✖ Expected "#no-id" to have no more than 0 ID selectors selector-max-id␊
26:5 ⚠ Unexpected union class name with the parent selector (&) scss/selector-no-union-class-name␊
28:13 ✖ Expected nesting depth to be no more than 2 max-nesting-depth␊
31:6 ⚠ Insert "⏎" prettier/prettier␊
8 problems (6 errors, 2 warnings)␊
9 problems (6 errors, 3 warnings)␊
[__:__:__] Finished 'css__lint' after ____ ms␊
[__:__:__] Finished 'default' after ____ ms␊
Expand Down Expand Up @@ -118,9 +120,11 @@ Generated by [AVA](https://avajs.dev).
[__:__:__]␊
css/style.scss␊
13:5 ⚠ Unexpected union class name with the parent selector (&) scss/selector-no-union-class-name␊
23:5 ⚠ Unexpected union class name with the parent selector (&) scss/selector-no-union-class-name␊
57:1 ⚠ Unexpected browser feature "fullscreen" is only partially supported by Safari 15,15.4,15.5,15.6,16.0,16.1,16.2,16.3,15.1,15.2-15.3, Safari on iOS 15.0-15.1,15.2-15.3,15.4,15.5,15.6-15.7,16.0,16.1,16.2,16.3,16.4,16.5,16.6-16.7,17.0,17.1 plugin/no-unsupported-browser-features␊
1 problem (0 errors, 1 warning)␊
3 problems (0 errors, 3 warnings)␊
[__:__:__] Finished 'css__lint' after ____ ms␊
[__:__:__] Finished 'default' after ____ ms␊
Expand Down Expand Up @@ -213,10 +217,12 @@ Generated by [AVA](https://avajs.dev).
[__:__:__]␊
css/style.scss␊
13:5 ⚠ Unexpected union class name with the parent selector (&) scss/selector-no-union-class-name␊
23:5 ⚠ Unexpected union class name with the parent selector (&) scss/selector-no-union-class-name␊
57:1 ⚠ Unexpected browser feature "fullscreen" is only partially supported by IE 11, Safari 10 plugin/no-unsupported-browser-features␊
58:5 ⚠ Unexpected browser feature "flexbox" is only partially supported by IE 11 plugin/no-unsupported-browser-features␊
2 problems (0 errors, 2 warnings)␊
4 problems (0 errors, 4 warnings)␊
[__:__:__] Finished 'css__lint' after ____ ms␊
[__:__:__] Finished 'default' after ____ ms␊
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ Generated by [AVA](https://avajs.dev).
10:1 ✖ Expected ".notAComponent" to match pattern "/^(_)?(?:(?:u|t|(?:i|ha)?s)+-[a-z$]+[a-zA-Z0-9$()]*|(?:[a-z$][a-zA-Z0-9$()]+-)?[A-Z$][a-zA-Z0-9$()]*(__[a-z0-9$][a-zA-Z0-9$()]*)*(--[a-z0-9$][a-zA-Z0-9$()]*)*)$/" selector-class-pattern␊
15:1 ✖ A state must be linked to a component swissquote/no-state-without-component␊
20:1 ✖ Expected "#no-id" to have no more than 0 ID selectors selector-max-id␊
26:5 ⚠ Unexpected union class name with the parent selector (&) scss/selector-no-union-class-name␊
28:13 ✖ Expected nesting depth to be no more than 2 max-nesting-depth␊
38:16 ✖ Insert "⏎" prettier/prettier␊
8 problems (8 errors, 0 warnings)␊
9 problems (8 errors, 1 warning)␊
`,
}
Expand Down Expand Up @@ -62,10 +63,11 @@ Generated by [AVA](https://avajs.dev).
10:1 ✖ Expected ".notAComponent" to match pattern "/^(_)?(?:(?:u|t|(?:i|ha)?s)+-[a-z$]+[a-zA-Z0-9$()]*|(?:[a-z$][a-zA-Z0-9$()]+-)?[A-Z$][a-zA-Z0-9$()]*(__[a-z0-9$][a-zA-Z0-9$()]*)*(--[a-z0-9$][a-zA-Z0-9$()]*)*)$/" selector-class-pattern␊
15:1 ✖ A state must be linked to a component swissquote/no-state-without-component␊
20:1 ✖ Expected "#no-id" to have no more than 0 ID selectors selector-max-id␊
26:5 ⚠ Unexpected union class name with the parent selector (&) scss/selector-no-union-class-name␊
28:13 ✖ Expected nesting depth to be no more than 2 max-nesting-depth␊
38:16 ✖ Insert "⏎" prettier/prettier␊
6 problems (6 errors, 0 warnings)␊
7 problems (6 errors, 1 warning)␊
`,
}
Expand Down
Binary file not shown.
2 changes: 2 additions & 0 deletions packages/stylelint-config-swissquote/recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module.exports = {
"property-no-vendor-prefix": [true, { disableFix: true }],
"selector-no-vendor-prefix": [true, { disableFix: true }],
"value-no-vendor-prefix": [true, { disableFix: true }],
// Union class names won't be possible when using standard CSS nesting
"scss/selector-no-union-class-name": [true, { severity: "warning" }],

// Misc
// ---------------------------------------------------------------------
Expand Down

0 comments on commit dfd3ca8

Please sign in to comment.