Skip to content

Commit 4bad6b2

Browse files
committed
Upgrade Stylelint to v16 and @visionappscz/stylelint-config to v4.0.0-beta1 #484
For now, the order plugin is being repeatedly disabled in places where the new config requires line rules to precede block rules. This may be addressed in the new version of the config.
1 parent 6940731 commit 4bad6b2

File tree

8 files changed

+1125
-1927
lines changed

8 files changed

+1125
-1927
lines changed

package-lock.json

Lines changed: 1093 additions & 1909 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"@testing-library/react": "^16.0.0",
7272
"@testing-library/user-event": "^14.5.2",
7373
"@visionappscz/eslint-config-visionapps": "^1.7.0",
74-
"@visionappscz/stylelint-config": "^3.0.0",
74+
"@visionappscz/stylelint-config": "^4.0.0-beta1",
7575
"autoprefixer": "^10.4.19",
7676
"babel-jest": "^29.7.0",
7777
"babel-loader": "^9.1.3",
@@ -94,8 +94,8 @@
9494
"prop-types": "^15.8.1",
9595
"sass": "^1.77.6",
9696
"sass-loader": "^14.2.1",
97-
"stylelint": "^14.16.1",
98-
"stylelint-webpack-plugin": "^4.1.1",
97+
"stylelint": "^16.7.0",
98+
"stylelint-webpack-plugin": "^5.0.1",
9999
"terser-webpack-plugin": "^5.3.10",
100100
"webpack": "^5.92.1",
101101
"webpack-cli": "^5.1.4",

src/components/Button/_base.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@
4545

4646
.feedbackIcon {
4747
position: absolute;
48-
top: 0;
49-
right: 0;
50-
bottom: 0;
51-
left: 0;
48+
inset: 0;
5249
z-index: 1;
5350
align-items: center;
5451
}

src/components/Grid/Grid.module.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@
3535
grid-template-rows: var(--rui-local-rows); // 2.
3636
grid-auto-flow: var(--rui-local-auto-flow); // 2.
3737
grid-gap: var(--rui-local-row-gap) var(--rui-local-column-gap); // 2.
38-
align-content: var(--rui-local-align-content); // 2.
39-
align-items: var(--rui-local-align-items); // 2.
40-
justify-content: var(--rui-local-justify-content); // 2.
41-
justify-items: var(--rui-local-justify-items); // 2.
38+
place-content: var(--rui-local-align-content) var(--rui-local-justify-content); // 2.
39+
place-items: var(--rui-local-align-items) var(--rui-local-justify-items); // 2.
4240
}
4341

4442
// stylelint-disable-next-line selector-max-universal -- Reset any previously added margins.

src/components/Modal/Modal.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
max-width: var(--rui-local-max-width);
2222
max-height: var(--rui-local-max-height);
2323
overflow-y: auto;
24-
overscroll-behavior: contain;
2524
border-radius: settings.$border-radius;
2625
background: theme.$background;
2726
box-shadow: theme.$box-shadow;
2827
transform: translateX(-50%);
28+
overscroll-behavior: contain;
2929

3030
@include breakpoint.up(sm) {
3131
--rui-local-outer-spacing: #{theme.$outer-spacing-sm};

src/components/ScrollView/ScrollView.module.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ $_arrow-outer-spacing: spacing.of(4);
103103

104104
.isRootVertical .viewport {
105105
height: 100%;
106-
overflow-x: clip; // 7., 8.
107-
overflow-y: auto; // 2.
106+
overflow: clip auto; // 7., 8. / 2.
108107
}
109108

110109
.isRootVertical .arrowPrev {
@@ -183,8 +182,7 @@ $_arrow-outer-spacing: spacing.of(4);
183182
}
184183

185184
.isRootHorizontal .viewport {
186-
overflow-x: auto; // 2.
187-
overflow-y: clip; // 5., 7., 8.
185+
overflow: auto clip; // 2. / 5., 7., 8.
188186
}
189187

190188
.isRootHorizontal .content {

src/styles/tools/form-fields/_box-field-layout.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@
125125

126126
.field {
127127
grid-area: field;
128-
align-self: theme.$horizontal-field-vertical-alignment; // 13.
129-
justify-self: start; // 7.
128+
place-self: theme.$horizontal-field-vertical-alignment start; // 13. / 7.
130129
}
131130
}
132131
}

stylelint.config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,28 @@ module.exports = {
2020
message: 'Expected custom property name to start with `rui-*` and follow either SUIT CSS or kebab-case syntax',
2121
},
2222
],
23+
24+
// Override `@visionappscz/stylelint-config/order` rules to ignore all block at rules:
25+
'order/order': [
26+
'dollar-variables',
27+
'custom-properties',
28+
{
29+
name: 'extend',
30+
type: 'at-rule',
31+
},
32+
{
33+
hasBlock: false,
34+
name: 'include',
35+
type: 'at-rule',
36+
},
37+
'declarations',
38+
'rules',
39+
// {
40+
// hasBlock: true,
41+
// type: 'at-rule',
42+
// },
43+
],
44+
2345
// Require camelCase pattern for class names as they are picked up by dot notation in JS.
2446
// Also allow kebab-case class names for global helper and utility classes.
2547
//

0 commit comments

Comments
 (0)