Skip to content
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

Deps: Update dependency stylelint to v16 #1539

Merged
merged 4 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions configs/stylelint-config-spirit/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const prettierPlugin = require('./plugins/prettier');
const styleRules = require('./rules/style');
const unstableRules = require('./rules/unstable');
/* eslint-disable import/extensions -- Cannot find module error */
import prettierPlugin from './plugins/prettier.js';
import styleRules from './rules/style.js';
import unstableRules from './rules/unstable.js';

module.exports = {
extends: ['@lmc-eu/stylelint-config', prettierPlugin, styleRules, unstableRules],
export default {
extends: ['@almacareer/stylelint-config', prettierPlugin, styleRules, unstableRules],
};
12 changes: 6 additions & 6 deletions configs/stylelint-config-spirit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
"url": "https://github.com/lmc-eu/spirit-design-system.git",
"directory": "configs/stylelint-config-spirit"
},
"type": "commonjs",
"type": "module",
"main": "./index.js",
"peerDependencies": {
"stylelint": "^15.11.0"
"stylelint": "^16.0.0"
},
"dependencies": {
"@lmc-eu/stylelint-config": "8.0.0",
"stylelint": "15.11.0",
"stylelint-config-prettier": "9.0.5",
"stylelint-order": "6.0.4"
"@almacareer/stylelint-config": "9.0.0",
"stylelint": "16.7.0",
"stylelint-order": "6.0.4",
"stylelint-prettier": "5.0.0"
}
}
7 changes: 5 additions & 2 deletions configs/stylelint-config-spirit/plugins/prettier.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
module.exports = {
extends: ['stylelint-config-prettier'],
export default {
plugins: ['stylelint-prettier'],
rules: {
'prettier/prettier': true,
},
literat marked this conversation as resolved.
Show resolved Hide resolved
};
2 changes: 1 addition & 1 deletion configs/stylelint-config-spirit/rules/style.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const OFF = null;

module.exports = {
export default {
rules: {
// This rule can lead to less readable code
// @see: https://github.com/stylelint/stylelint-config-recommended/issues/14
Expand Down
2 changes: 1 addition & 1 deletion configs/stylelint-config-spirit/rules/unstable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
rules: {
// Allow UNSTABLE_Component classnames
// @see: https://github.com/lmc-eu/spirit-design-system/blob/main/docs/contributtion/experimental-code.md
Expand Down
2 changes: 1 addition & 1 deletion packages/design-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"npm-run-all2": "6.2.0",
"rimraf": "5.0.7",
"shx": "0.3.4",
"stylelint": "15.11.0",
"stylelint": "16.7.0",
"stylelint-config-spirit": "workspace:^",
"typescript": "5.5.2",
"vite": "5.3.2",
Expand Down
4 changes: 3 additions & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@
"@lmc-eu/spirit-common": "^0.3.5",
"@lmc-eu/spirit-demo": "^0.1.3",
"@rollup/plugin-typescript": "11.1.6",
"@types/eslint": "^9",
"@types/jest": "29.5.12",
"autoprefixer": "10.4.19",
"clean-css-cli": "5.6.3",
"eslint": "8.57.0",
"glob": "10.4.2",
"jest": "29.7.0",
"npm-run-all": "4.1.5",
Expand All @@ -74,7 +76,7 @@
"sass": "1.77.6",
"sass-true": "8.0.0",
"shx": "0.3.4",
"stylelint": "15.11.0",
"stylelint": "16.7.0",
"stylelint-config-spirit": "workspace:^",
"tslib": "2.6.3",
"typescript": "5.5.2"
Expand Down
1 change: 0 additions & 1 deletion packages/web/src/scss/components/Alert/_Alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
}

@include dictionaries.generate-colors('Alert', theme.$color-dictionary, theme.$color-dictionary-config);

@include dictionaries.generate-colors(
'Alert',
theme.$color-dictionary,
Expand Down
1 change: 0 additions & 1 deletion packages/web/src/scss/components/Button/_Button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
$overrides: theme.$color-dictionary-overrides,
$generate-data-attribute: true
);

@include dictionaries.generate-sizes('Button', theme.$sizes);

.Button--block {
Expand Down
1 change: 0 additions & 1 deletion packages/web/src/scss/components/Grid/_Grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@
}

@include tools.equal-columns(theme.$grid-equal-columns, theme.$breakpoints);

@include tools.item(theme.$breakpoints);
2 changes: 0 additions & 2 deletions packages/web/src/scss/components/Tag/_Tag.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@
}

@include dictionaries.generate-sizes('Tag', theme.$sizes);

@include dictionaries.generate-colors(
'Tag',
theme.$color-dictionary,
theme.$color-dictionary-config,
null,
theme.$color-dictionary-overrides
);

@include dictionaries.generate-colors(
'Tag--subtle.Tag',
theme.$color-dictionary,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
@media (width >= 768px) {
.UNSTABLE_Section:not(:last-child) {
margin-bottom: 4rem;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/scss/tools/__tests__/_breakpoint.test.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}

@include test.expect() {
@media (min-width: 600px) {
@media (width >= 600px) {
.selector {
color: #bada55;
}
Expand Down Expand Up @@ -53,7 +53,7 @@
}

@include test.expect() {
@media (max-width: 599px) {
@media (width < 600px) {
.selector {
color: #bada55;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@include form-fields.label-disabled();
}
}

@include test.expect() {
.label-disabled-test {
color: form-fields-theme.$label-color-disabled;
Expand All @@ -30,6 +31,7 @@
@include form-fields.input-disabled();
}
}

@include test.expect() {
.input-disabled-test {
color: form-fields-theme.$input-color-disabled;
Expand All @@ -46,6 +48,7 @@
@include form-fields.box-field-fluid();
}
}

@include test.expect() {
.box-field-fluid-test {
width: 100%;
Expand Down
2 changes: 0 additions & 2 deletions packages/web/src/scss/tools/__tests__/_list.test.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
@include test.describe('to-string function') {
@include test.it('should convert a list to a string with the specified separator') {
@include test.assert-equal(list.to-string((1, 2, 3), '-'), '1-2-3');

@include test.assert-equal(list.to-string(('a', 'b', 'c'), '_'), 'a_b_c');

@include test.assert-equal(list.to-string(('apple', 'banana', 'cherry')), 'apple banana cherry');
}
}
13 changes: 13 additions & 0 deletions packages/web/src/scss/tools/__tests__/_placement.test.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
--cross-axis-direction-left: #{placement.get-cross-axis-direction('left')};
--cross-axis-direction-bottom: #{placement.get-cross-axis-direction('bottom')};
}

@include test.expect() {
--cross-axis-direction-left: vertical;
--cross-axis-direction-bottom: horizontal;
Expand All @@ -21,6 +22,7 @@
--is-logical-left: #{placement.is-logical('left')};
--is-logical-start: #{placement.is-logical('start')};
}

@include test.expect() {
--is-logical-left: false;
--is-logical-start: true;
Expand All @@ -34,6 +36,7 @@
--logical-to-physical-start-horizontal: #{placement.translate-logical-to-physical('start', 'horizontal')};
--logical-to-physical-start-vertical: #{placement.translate-logical-to-physical('start', 'vertical')};
}

@include test.expect() {
--logical-to-physical-start-horizontal: left;
--logical-to-physical-start-vertical: top;
Expand Down Expand Up @@ -61,6 +64,7 @@
$physical-direction: 'horizontal'
)};
}

@include test.expect() {
--transform-axis-left: left;
--transform-axis-left-inverse: right;
Expand Down Expand Up @@ -94,6 +98,7 @@
)};
--transform-left-top-spaces: #{placement.transform('left-top', $join-with: ' ')};
}

@include test.expect() {
--transform-left: left;
--transform-left-top: left-top;
Expand Down Expand Up @@ -131,6 +136,7 @@
)};
--transform-top-start-spaces: #{placement.transform('top-start', $join-with: ' ')};
}

@include test.expect() {
--transform-top-start: top-start;
--transform-top-start-main-axis-inverse: bottom-start;
Expand All @@ -150,6 +156,7 @@
@include placement.parent();
}
}

@include test.expect() {
.parent-test {
position: relative;
Expand All @@ -165,6 +172,7 @@
@include placement.child($z-index: 3);
}
}

@include test.expect() {
.child-test {
position: absolute;
Expand All @@ -181,6 +189,7 @@
@include placement.child-controlled('test', 10px);
}
}

@include test.expect() {
.child-controlled-test {
--test-offset-orthogonal: 0;
Expand All @@ -200,6 +209,7 @@
@include placement.child-variant($prefix: 'test', $placement: 'top', $offset: 10px);
}
}

@include test.expect() {
.child-variant-test {
--test-offset: 10px;
Expand All @@ -222,6 +232,7 @@
);
}
}

@include test.expect() {
.child-variant-test {
--test-offset: 10px;
Expand All @@ -240,6 +251,7 @@
@include placement.arrow('test', '10px', '10px', '5px');
}
}

@include test.expect() {
.arrow-test {
--test-arrow-width: 10px;
Expand All @@ -260,6 +272,7 @@
@include placement.arrow-variant('test', 'top');
}
}

@include test.expect() {
.arrow-variant-test {
inset: auto auto 100% 50%;
Expand Down
4 changes: 0 additions & 4 deletions packages/web/src/scss/tools/__tests__/_string.test.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
@include test.describe('convert-kebab-case-to-camel-case function') {
@include test.it('should convert kebab-case to camelCase') {
@include test.assert-equal(string.convert-kebab-case-to-camel-case('top-start'), 'topStart');

@include test.assert-equal(
string.convert-kebab-case-to-camel-case('my-long-variable-name'),
'myLongVariableName'
Expand All @@ -15,7 +14,6 @@
@include test.describe('convert-pascal-case-to-kebab-case function') {
@include test.it('should convert PascalCase to kebab-case') {
@include test.assert-equal(string.convert-pascal-case-to-kebab-case('TopStart'), 'top-start');

@include test.assert-equal(
string.convert-pascal-case-to-kebab-case('MyLongVariableName'),
'my-long-variable-name'
Expand All @@ -26,9 +24,7 @@
@include test.describe('replace function') {
@include test.it('should replace all occurrences of a substring with another string') {
@include test.assert-equal(string.replace('top-start', '-', ''), 'topstart');

@include test.assert-equal(string.replace('some-other-text', 'e', 'a'), 'soma-othar-taxt');

@include test.assert-equal(string.replace('no-replacement-here', 'z', 'y'), 'no-replacement-here');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}

@include test.expect() {
@media (min-width: map.get(tokens.$breakpoints, 'tablet')) {
@media (width >= #{map.get(tokens.$breakpoints, 'tablet')}) {
.typography-test {
font-style: italic;
font-weight: 700;
Expand Down
18 changes: 10 additions & 8 deletions packages/web/src/scss/tools/_breakpoint.scss
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
// Mixin to get the min-width media query for a breakpoint value.
@use 'sass:string';

// Mixin to get the width media query for a breakpoint value in up direction.
//
// Example: up(0) { … } will return …
// Example: up(768px) { … } will return @media (min-width: 768px) { … }
// Example: up(768px) { … } will return @media (width >= 768px) { … }
//
// Parameters are:
// * $breakpoint-value: the breakpoint value (in pixels)
@mixin up($breakpoint-value) {
@if $breakpoint-value > 0 {
@media (min-width: $breakpoint-value) {
@media (width >= $breakpoint-value) {
@content;
}
} @else {
@content;
}
}

// Mixin to get the max-width media query for a breakpoint value.
// Mixin to get the width media query for a breakpoint value in down direction.
//
// Example: down(0) { … } will return …
// Example: down(768px) { … } will return @media (max-width: 767px) { … }
// Example: down(768px) { … } will return @media (width < 768px) { … }
//
// Parameters are:
// * $breakpoint-value: the breakpoint value (in pixels)
@mixin down($breakpoint-value) {
@if $breakpoint-value > 0 {
@media (max-width: ($breakpoint-value - 1px)) {
@media (width < $breakpoint-value) {
@content;
}
} @else {
Expand All @@ -45,10 +47,10 @@
@function get-modifier($modifier, $name, $breakpoint-value) {
@if $breakpoint-value > 0 {
@if $modifier == 'infix' {
@return unquote($name + '--');
@return string.unquote($name + '--');
}

@return unquote('-' + $name);
@return string.unquote('-' + $name);
}

@return '';
Expand Down
Loading
Loading