From 2d27ca1245d393ef3ba95a1802cfd267e8b45242 Mon Sep 17 00:00:00 2001 From: literat Date: Wed, 3 Jul 2024 23:03:29 +0200 Subject: [PATCH] fixup! Chore(repo): Upgrade to Stylelint 16 #DS-1245 --- configs/stylelint-config-spirit/index.js | 116 ------------------- configs/stylelint-config-spirit/package.json | 1 - yarn.lock | 80 +------------ 3 files changed, 2 insertions(+), 195 deletions(-) diff --git a/configs/stylelint-config-spirit/index.js b/configs/stylelint-config-spirit/index.js index a51b28083b..3731523d8b 100644 --- a/configs/stylelint-config-spirit/index.js +++ b/configs/stylelint-config-spirit/index.js @@ -4,120 +4,4 @@ const unstableRules = require('./rules/unstable'); module.exports = { extends: ['@lmc-eu/stylelint-config', prettierPlugin, styleRules, unstableRules], - /* rules: { - // No default value - // Reason: Color-named values disabled - desired lint should check for design system token values only. - // Docs: https://stylelint.io/user-guide/rules/list/color-named - 'color-named': 'never', - - // Reason: Except for utility classes and third-party overrides, !important can be avoided. - // Docs: https://stylelint.io/user-guide/rules/list/declaration-no-important - 'declaration-no-important': true, - - // Reasons: - // - Background images should be stored locally. - // - Lets make people think more about what actually needs to be animated. Only hardware-accelerable properties should be transitioned. - // Docs: https://stylelint.io/user-guide/rules/list/declaration-property-value-disallowed-list - 'declaration-property-value-disallowed-list': [ - { - '/^background/': ['http:', 'https:'], - '/^transition/': ['/all/'], - }, - { - message: - 'Transitioning all properties and absolute background URLs are not allowed (declaration-property-value-disallowed-list)', - }, - ], - - // No default value - // Reason: Declaring font weights in other ways is unsafe. - // Docs: https://stylelint.io/user-guide/rules/list/font-weight-notation - 'font-weight-notation': 'numeric', - - // Reason: Selector maximum class count should be just one but especially form parts/components - // need more complex selectors to add styles when validation is applied. - // Setting rule to "1" would be uneasy to pass in almost all projects so "2" is clearly just fine. - // In case of inevitable more complex selector it is allowed and recommended to locally disable that rule. - // Docs: https://stylelint.io/user-guide/rules/list/selector-max-class - 'selector-max-class': 2, - - // Reason: Keep selector specificity as low as possible by default. - // Docs: https://stylelint.io/user-guide/rules/list/selector-max-compound-selectors - 'selector-max-compound-selectors': 3, - - // Reason: IDs are handy for Javascript, not for CSS anymore. - // Docs: https://stylelint.io/user-guide/rules/list/selector-max-id - 'selector-max-id': 0, - - // Reason: Keep selector specificity as low as possible by default. - // Docs: https://stylelint.io/user-guide/rules/list/selector-max-specificity - 'selector-max-specificity': '0,4,0', - - // Reason: Most of the time, we should know what elements or classes we are targeting. - // Docs: https://stylelint.io/user-guide/rules/list/selector-max-universal - 'selector-max-universal': 0, - - // Reason: Avoid compound selectors' creation using nested ampersand SASS syntax. - // Main reasons why use this pattern: - // - Unification with design system components code style - // - Look up easily for the selector using fulltext search in IDEs - // - Better orientation in longer component's code when scrolled down - // - Makes `no-descending-specificity` stylelint rule work correctly - // - IDE's support clicking through from selector usage to its source - // Docs: https://stylelint.io/user-guide/rules/list/selector-nested-pattern/ - 'selector-nested-pattern': [ - '(^&:)|(^&\\[)|(^&\\.(is\\-|has\\-))', - { - message: - 'Only pseudo class selector, attribute selector and combination with state class is allowed (selector-nested-pattern)', - }, - ], - - // Reason: In most cases, it only needlessly increases selector specificity. - // Docs: https://stylelint.io/user-guide/rules/list/selector-no-qualifying-type - 'selector-no-qualifying-type': true, - - // Default value: 'always' with secondary options. - // Reason: Turned off to support grouping variables using empty lines. - // Docs: https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/dollar-variable-empty-line-before/README.md - 'scss/dollar-variable-empty-line-before': null, - - // Default value: 'never' - // Reasons: - // - The aim is unified syntax; - // - mixin is a callable function; - // - will not be misunderstood with extended selector. - // Docs: https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/at-mixin-argumentless-call-parentheses/README.md - 'scss/at-mixin-argumentless-call-parentheses': 'always', - - // Default value: true - // Reason: Since there is `max-line-length` rule se to max. 120 chars, it should be allowed to use a new line for better code readability. - // Docs: https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/operator-no-newline-after/README.md - 'scss/operator-no-newline-after': null, - - // Default value: true - // Reason: Since there is `max-line-length` rule se to max. 120 chars, it should be allowed to use a new line for better code readability. - // (same reason for rule above) - // Docs: https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/operator-no-newline-before/README.md - 'scss/operator-no-newline-before': null, - - // Default value: 'always' - // Reason: Support multi-line value definitions lets developer make code more readable. - // It is handy especially for uneasy math calculations. - // Docs: https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/dollar-variable-colon-space-after/README.md - 'scss/dollar-variable-colon-space-after': 'always-single-line', - - // Default value `comment-no-empty`: null - // Default value `scss/comment-no-empty`: true - // Reason: Allow empty lines in structured block comments. - // Docs: https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/comment-no-empty/README.md - 'scss/comment-no-empty': null, - - // Default value: true - // Reasons: - // - In some cases it is handy to use functions like `unquote`; - // - values come from Supernova, so you never know what you're going to get. - // Docs: https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/function-unquote-no-unquoted-strings-inside/README.md - 'scss/function-unquote-no-unquoted-strings-inside': null, - } */ }; diff --git a/configs/stylelint-config-spirit/package.json b/configs/stylelint-config-spirit/package.json index eb63724045..66e4ffcbab 100644 --- a/configs/stylelint-config-spirit/package.json +++ b/configs/stylelint-config-spirit/package.json @@ -29,7 +29,6 @@ "@lmc-eu/stylelint-config": "file:/Users/tomas.litera/Work/_alma/code-quality-tools/packages/stylelint-config", "stylelint": "15.11.0", "stylelint-config-prettier": "9.0.5", - "stylelint-config-standard-scss": "13.1.0", "stylelint-order": "6.0.4" } } diff --git a/yarn.lock b/yarn.lock index edc1d4a6a3..1ab9fad5fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18702,13 +18702,6 @@ __metadata: languageName: node linkType: hard -"known-css-properties@npm:^0.31.0": - version: 0.31.0 - resolution: "known-css-properties@npm:0.31.0" - checksum: 10/559679a98e58806c77c267aaaad56217a0d456e59d1f64e4d4ae5ee90319f888064f93e2acaed67b117badd723c22c1bec3cb38a07482c7de331b93fb2ba0c94 - languageName: node - linkType: hard - "kolorist@npm:^1.8.0": version: 1.8.0 resolution: "kolorist@npm:1.8.0" @@ -22530,7 +22523,7 @@ __metadata: languageName: node linkType: hard -"postcss-scss@npm:^4.0.2, postcss-scss@npm:^4.0.3, postcss-scss@npm:^4.0.9": +"postcss-scss@npm:^4.0.2, postcss-scss@npm:^4.0.3": version: 4.0.9 resolution: "postcss-scss@npm:4.0.9" peerDependencies: @@ -22539,7 +22532,7 @@ __metadata: languageName: node linkType: hard -"postcss-selector-parser@npm:^6.0.10, postcss-selector-parser@npm:^6.0.11, postcss-selector-parser@npm:^6.0.13, postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4, postcss-selector-parser@npm:^6.1.0": +"postcss-selector-parser@npm:^6.0.10, postcss-selector-parser@npm:^6.0.11, postcss-selector-parser@npm:^6.0.13, postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4": version: 6.1.0 resolution: "postcss-selector-parser@npm:6.1.0" dependencies: @@ -25723,23 +25716,6 @@ __metadata: languageName: node linkType: hard -"stylelint-config-recommended-scss@npm:^14.0.0": - version: 14.0.0 - resolution: "stylelint-config-recommended-scss@npm:14.0.0" - dependencies: - postcss-scss: "npm:^4.0.9" - stylelint-config-recommended: "npm:^14.0.0" - stylelint-scss: "npm:^6.0.0" - peerDependencies: - postcss: ^8.3.3 - stylelint: ^16.0.2 - peerDependenciesMeta: - postcss: - optional: true - checksum: 10/512fba4d81654b65a7a36d531f165c7d8f0c938e63a0f90daca0c21d623cc637e29195fec5e0ae1edd862502d69717f6f3e90016cd7ba8458e4a8afcd87bb3b4 - languageName: node - linkType: hard - "stylelint-config-recommended-scss@npm:^8.0.0": version: 8.0.0 resolution: "stylelint-config-recommended-scss@npm:8.0.0" @@ -25757,15 +25733,6 @@ __metadata: languageName: node linkType: hard -"stylelint-config-recommended@npm:^14.0.0, stylelint-config-recommended@npm:^14.0.1": - version: 14.0.1 - resolution: "stylelint-config-recommended@npm:14.0.1" - peerDependencies: - stylelint: ^16.1.0 - checksum: 10/93c3fe920902abfd3f4130173876bb633230c910a3b293f5b74a0ea9c4427d197d7ade28dd62718246264f22f1e012899d0160a0176da723d14680d73876d701 - languageName: node - linkType: hard - "stylelint-config-recommended@npm:^9.0.0": version: 9.0.0 resolution: "stylelint-config-recommended@npm:9.0.0" @@ -25782,29 +25749,12 @@ __metadata: "@lmc-eu/stylelint-config": "file:/Users/tomas.litera/Work/_alma/code-quality-tools/packages/stylelint-config" stylelint: "npm:15.11.0" stylelint-config-prettier: "npm:9.0.5" - stylelint-config-standard-scss: "npm:13.1.0" stylelint-order: "npm:6.0.4" peerDependencies: stylelint: ^15.11.0 languageName: unknown linkType: soft -"stylelint-config-standard-scss@npm:13.1.0": - version: 13.1.0 - resolution: "stylelint-config-standard-scss@npm:13.1.0" - dependencies: - stylelint-config-recommended-scss: "npm:^14.0.0" - stylelint-config-standard: "npm:^36.0.0" - peerDependencies: - postcss: ^8.3.3 - stylelint: ^16.3.1 - peerDependenciesMeta: - postcss: - optional: true - checksum: 10/c5105e3b3390c9d0aa95e252abdf1850fa50d82e1a25a1fcc11a88b111038e00c8033a4b34905405f2203c84c0fa26ce1d40248df2172c83c76cc3baa552db07 - languageName: node - linkType: hard - "stylelint-config-standard-scss@npm:^6.0.0": version: 6.1.0 resolution: "stylelint-config-standard-scss@npm:6.1.0" @@ -25832,17 +25782,6 @@ __metadata: languageName: node linkType: hard -"stylelint-config-standard@npm:^36.0.0": - version: 36.0.1 - resolution: "stylelint-config-standard@npm:36.0.1" - dependencies: - stylelint-config-recommended: "npm:^14.0.1" - peerDependencies: - stylelint: ^16.1.0 - checksum: 10/50b8fb396f1cb8cb3539aa97187eb8c2a4b2858c897374faa726837a809dae7c686cb5dc32528c9698745d4e97af1fe9035a04a5a8cb220bd6b1530795437013 - languageName: node - linkType: hard - "stylelint-order@npm:6.0.4, stylelint-order@npm:^6.0.0": version: 6.0.4 resolution: "stylelint-order@npm:6.0.4" @@ -25869,21 +25808,6 @@ __metadata: languageName: node linkType: hard -"stylelint-scss@npm:^6.0.0": - version: 6.3.2 - resolution: "stylelint-scss@npm:6.3.2" - dependencies: - known-css-properties: "npm:^0.31.0" - postcss-media-query-parser: "npm:^0.2.3" - postcss-resolve-nested-selector: "npm:^0.1.1" - postcss-selector-parser: "npm:^6.1.0" - postcss-value-parser: "npm:^4.2.0" - peerDependencies: - stylelint: ^16.0.2 - checksum: 10/c60f5b1538cc5589addbd86b94fd62e140a453008549c05902c87b8a72c854fdb4b966dd8fd17cf61fbcd665db40eb2109f086f1f4ba5399a07ff59500bdeac1 - languageName: node - linkType: hard - "stylelint@npm:15.11.0": version: 15.11.0 resolution: "stylelint@npm:15.11.0"