Skip to content

Commit

Permalink
Upgrade Stylelint to v16 and @visionappscz/stylelint-config to v4.0…
Browse files Browse the repository at this point in the history
….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.
  • Loading branch information
adamkudrna committed Jul 29, 2024
1 parent 7a3eb69 commit b750460
Show file tree
Hide file tree
Showing 14 changed files with 2,877 additions and 2,575 deletions.
5,413 changes: 2,856 additions & 2,557 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@visionappscz/eslint-config-visionapps": "^1.7.0",
"@visionappscz/stylelint-config": "^3.0.0",
"@visionappscz/stylelint-config": "^4.0.0-beta1",
"autoprefixer": "^10.4.15",
"babel-jest": "^29.6.4",
"babel-loader": "^9.1.3",
Expand All @@ -94,8 +94,8 @@
"prop-types": "^15.8.1",
"sass": "^1.66.1",
"sass-loader": "^13.3.2",
"stylelint": "^14.16.1",
"stylelint-webpack-plugin": "^4.1.1",
"stylelint": "^16.7.0",
"stylelint-webpack-plugin": "^5.0.1",
"terser-webpack-plugin": "^5.3.9",
"webpack": "^5.69.1",
"webpack-cli": "^5.1.4",
Expand Down
5 changes: 1 addition & 4 deletions src/components/Button/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@

.feedbackIcon {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
inset: 0;
z-index: 1;
align-items: center;
}
Expand Down
1 change: 1 addition & 0 deletions src/components/Button/_tools.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
+ "Choose one of #{settings.$themeable-states}.";
}

// stylelint-disable-next-line order/order -- Prefer the "return/error early" approach.
$properties: map.get(settings.$themeable-priority-properties, $priority);

// 2.
Expand Down
6 changes: 2 additions & 4 deletions src/components/Grid/Grid.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@
grid-template-rows: var(--rui-local-rows); // 2.
grid-auto-flow: var(--rui-local-auto-flow); // 2.
grid-gap: var(--rui-local-row-gap) var(--rui-local-column-gap); // 2.
align-content: var(--rui-local-align-content); // 2.
align-items: var(--rui-local-align-items); // 2.
justify-content: var(--rui-local-justify-content); // 2.
justify-items: var(--rui-local-justify-items); // 2.
place-content: var(--rui-local-align-content) var(--rui-local-justify-content); // 2.
place-items: var(--rui-local-align-items) var(--rui-local-justify-items); // 2.
}

// stylelint-disable-next-line selector-max-universal -- Reset any previously added margins.
Expand Down
1 change: 1 addition & 0 deletions src/components/Grid/_tools.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@return $fallback-cascade;
}

// stylelint-disable-next-line order/order -- Prefer the "return/error early" approach.
$fallback-cascade: var(--rui-local-#{$property-name}-#{$breakpoint}, $fallback-cascade);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Modal.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
max-width: var(--rui-local-max-width);
max-height: var(--rui-local-max-height);
overflow-y: auto;
overscroll-behavior: contain;
border-radius: settings.$border-radius;
background: theme.$background;
box-shadow: theme.$box-shadow;
transform: translateX(-50%);
overscroll-behavior: contain;

@include breakpoint.up(sm) {
--rui-local-outer-spacing: #{theme.$outer-spacing-sm};
Expand Down
6 changes: 2 additions & 4 deletions src/components/ScrollView/ScrollView.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ $_arrow-outer-spacing: spacing.of(4);

.isRootVertical .viewport {
height: 100%;
overflow-x: clip; // 7., 8.
overflow-y: auto; // 2.
overflow: clip auto; // 7., 8. / 2.
}

.isRootVertical .arrowPrev {
Expand Down Expand Up @@ -183,8 +182,7 @@ $_arrow-outer-spacing: spacing.of(4);
}

.isRootHorizontal .viewport {
overflow-x: auto; // 2.
overflow-y: clip; // 5., 7., 8.
overflow: auto clip; // 2. / 5., 7., 8.
}

.isRootHorizontal .content {
Expand Down
1 change: 1 addition & 0 deletions src/styles/tools/_spacing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
+ "Choose one of #{map.keys(spacing.$bottom)}.";
}

// stylelint-disable-next-line order/order -- Prefer the "return/error early" approach.
&:not(:last-child) {
margin-bottom: map.get(spacing.$bottom, $category);
}
Expand Down
1 change: 1 addition & 0 deletions src/styles/tools/_transition.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ $_reduced-motion-disallowed-transitions: (transform);
@error "Transition properties must be a string or a Sass list, `#{$properties}` given.";
}

// stylelint-disable-next-line order/order -- Prefer the "return/error early" approach.
$property-list: list.join($property-list, $properties);

@if not _validate-transitions($property-list) {
Expand Down
6 changes: 4 additions & 2 deletions src/styles/tools/form-fields/_box-field-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
--rui-local-vertical-gap: #{settings.$vertical-inner-gap-large};
}

// stylelint-disable-next-line order/order -- Conditional styles.
display: inline-flex; // 1.
flex-direction: column;
min-width: 0; // 1.
Expand Down Expand Up @@ -119,14 +120,14 @@
padding-bottom: #{theme.$horizontal-label-padding-y};
}

// stylelint-disable-next-line order/order -- Conditional styles.
padding-right: settings.$horizontal-inner-gap; // 4.
text-align: theme.$horizontal-label-text-align;
}

.field {
grid-area: field;
align-self: theme.$horizontal-field-vertical-alignment; // 13.
justify-self: start; // 7.
place-self: theme.$horizontal-field-vertical-alignment start; // 13. / 7.
}
}
}
Expand Down Expand Up @@ -219,6 +220,7 @@
}
}

// stylelint-disable-next-line order/order -- Conditional styles.
&.isRootLayoutHorizontal .label,
&.isRootLayoutHorizontal .field,
&.isRootLayoutHorizontal .inputContainer,
Expand Down
1 change: 1 addition & 0 deletions src/styles/tools/form-fields/_inline-field-elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
$input-width: theme.$check-input-toggle-width;
}

// stylelint-disable-next-line order/order -- Conditional styles.
$tap-target-offset: calc((#{$input-width} - #{theme.$check-tap-target-size}) / 2);

@include accessibility.min-tap-target($size: theme.$check-tap-target-size, $center: false);
Expand Down
1 change: 1 addition & 0 deletions src/styles/tools/form-fields/_inline-field-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
justify-content: flex-end;
}

// stylelint-disable-next-line order/order -- Conditional styles.
.input {
flex: none;
}
Expand Down
2 changes: 2 additions & 0 deletions src/styles/tools/form-fields/_variants.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
+ "Choose one of #{map.keys(settings.$themeable-state-properties)}.";
}

// stylelint-disable-next-line order/order -- Prefer the "return/error early" approach.
$properties: map.get(settings.$themeable-state-properties, $state);
$infix: $type;
$fallback-state: "default";
Expand Down Expand Up @@ -70,6 +71,7 @@
+ "Choose one of #{map.keys(settings.$themeable-variant-states)}.";
}

// stylelint-disable-next-line order/order -- Prefer the "return/error early" approach.
$themeable-states: map.get(map.get(settings.$themeable-variant-states, $type), $variant);

@if list.index($themeable-states, "hover") {
Expand Down

0 comments on commit b750460

Please sign in to comment.