From 929fc39dbe67dd5a2044636c81028270679d9213 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Mon, 25 Sep 2023 17:36:36 +0200 Subject: [PATCH] Fixed deprecated stylelint rules --- .stylelintrc | 41 +++++++------ package-lock.json | 60 ++++++++++++++----- package.json | 1 + .../assets/stylesheets/custom/_typeset.scss | 4 +- .../stylesheets/main/components/_footer.scss | 2 +- .../stylesheets/main/components/_search.scss | 2 +- .../assets/stylesheets/palette/_scheme.scss | 2 +- 7 files changed, 73 insertions(+), 39 deletions(-) diff --git a/.stylelintrc b/.stylelintrc index 50538eb0c..b192c8d98 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -2,7 +2,8 @@ "extends": [ "stylelint-config-recess-order", "stylelint-config-recommended", - "stylelint-config-standard-scss" + "stylelint-config-standard-scss", + "stylelint-stylistic/config" ], "plugins": [ "stylelint-scss" @@ -32,16 +33,6 @@ } ], "at-rule-no-unknown": null, - "block-closing-brace-newline-after": [ - "always", - { - "ignoreAtRules": [ - "if", - "else", - "elseif" - ] - } - ], "color-function-notation": null, "color-hex-length": "long", "color-named": "never", @@ -58,12 +49,12 @@ "declaration-colon-space-after": null, "declaration-no-important": true, "declaration-block-single-line-max-declarations": 0, + "font-family-name-quotes": "always-where-recommended", + "font-weight-notation": "numeric", "function-calc-no-unspaced-operator": null, "function-no-unknown": null, "function-url-no-scheme-relative": true, "function-url-quotes": "always", - "font-family-name-quotes": "always-where-recommended", - "font-weight-notation": "numeric", "hue-degree-notation": "number", "length-zero-no-unit": [ true, @@ -71,12 +62,10 @@ "ignore": ["custom-properties"] } ], - "linebreaks": "unix", "media-feature-name-no-unknown": null, "media-feature-range-notation": null, "media-query-no-invalid": null, "no-descending-specificity": null, - "no-empty-first-line": true, "no-unknown-animations": true, "property-no-unknown": null, "property-no-vendor-prefix": [ @@ -92,13 +81,10 @@ "selector-combinator-space-before": null, "selector-descendant-combinator-no-non-space": null, "selector-id-pattern": null, - "selector-max-empty-lines": 0, "selector-max-id": 0, "selector-no-qualifying-type": null, "selector-pseudo-class-no-unknown": null, "selector-pseudo-element-no-unknown": null, - "string-quotes": "double", - "unicode-bom": "never", "unit-allowed-list": [ "%", "ch", @@ -160,6 +146,23 @@ "scss/operator-no-unspaced": true, "scss/partial-no-import": true, "scss/percent-placeholder-pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$", - "scss/selector-no-redundant-nesting-selector": true + "scss/selector-no-redundant-nesting-selector": true, + "stylistic/block-closing-brace-newline-after": [ + "always", + { + "ignoreAtRules": [ + "if", + "else", + "elseif" + ] + } + ], + "stylistic/declaration-colon-space-after": null, + "stylistic/no-empty-first-line": true, + "stylistic/linebreaks": "unix", + "stylistic/selector-max-empty-lines": 0, + "stylistic/string-quotes": "double", + "stylistic/unicode-bom": "never", + "stylistic/value-list-comma-newline-after": null } } diff --git a/package-lock.json b/package-lock.json index bc7271b94..28f3f3e61 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,6 +62,7 @@ "stylelint-config-recommended": "^13.0.0", "stylelint-config-standard-scss": "^11.0.0", "stylelint-scss": "^5.2.1", + "stylelint-stylistic": "^0.4.3", "svgo": "3.0.0", "tiny-glob": "^0.2.9", "ts-node": "^10.9.1", @@ -5140,6 +5141,15 @@ "node": ">=0.10.0" } }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -9335,6 +9345,22 @@ "stylelint": "^14.5.1 || ^15.0.0" } }, + "node_modules/stylelint-stylistic": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/stylelint-stylistic/-/stylelint-stylistic-0.4.3.tgz", + "integrity": "sha512-WphmneK3MRrm5ixvRPWy7+c9+EQUh0FPvNMXW/N9VD85vyqtpxUejpD+mxubVVht0fRgidcqBxtW3s3tU2Ujhw==", + "dev": true, + "dependencies": { + "is-plain-object": "^5.0.0", + "postcss": "^8.4.21", + "postcss-media-query-parser": "^0.2.3", + "postcss-value-parser": "^4.2.0", + "style-search": "^0.1.0" + }, + "peerDependencies": { + "stylelint": "^15.0.0" + } + }, "node_modules/stylelint/node_modules/balanced-match": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-2.0.0.tgz", @@ -9354,15 +9380,6 @@ "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" } }, - "node_modules/stylelint/node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/stylelint/node_modules/mdn-data": { "version": "2.0.30", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", @@ -13965,6 +13982,12 @@ "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", "dev": true }, + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true + }, "is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -16909,12 +16932,6 @@ "source-map-js": "^1.0.1" } }, - "is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true - }, "mdn-data": { "version": "2.0.30", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", @@ -17021,6 +17038,19 @@ "postcss-value-parser": "^4.2.0" } }, + "stylelint-stylistic": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/stylelint-stylistic/-/stylelint-stylistic-0.4.3.tgz", + "integrity": "sha512-WphmneK3MRrm5ixvRPWy7+c9+EQUh0FPvNMXW/N9VD85vyqtpxUejpD+mxubVVht0fRgidcqBxtW3s3tU2Ujhw==", + "dev": true, + "requires": { + "is-plain-object": "^5.0.0", + "postcss": "^8.4.21", + "postcss-media-query-parser": "^0.2.3", + "postcss-value-parser": "^4.2.0", + "style-search": "^0.1.0" + } + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", diff --git a/package.json b/package.json index 48e60bc47..47caf9e43 100644 --- a/package.json +++ b/package.json @@ -92,6 +92,7 @@ "stylelint-config-recommended": "^13.0.0", "stylelint-config-standard-scss": "^11.0.0", "stylelint-scss": "^5.2.1", + "stylelint-stylistic": "^0.4.3", "svgo": "3.0.0", "tiny-glob": "^0.2.9", "ts-node": "^10.9.1", diff --git a/src/overrides/assets/stylesheets/custom/_typeset.scss b/src/overrides/assets/stylesheets/custom/_typeset.scss index 345303cb6..bef300731 100644 --- a/src/overrides/assets/stylesheets/custom/_typeset.scss +++ b/src/overrides/assets/stylesheets/custom/_typeset.scss @@ -95,7 +95,7 @@ // Badge .mdx-badge { - font-size: .85em; + font-size: 0.85em; // Badge with heart &--heart { @@ -112,7 +112,7 @@ // Badge moved to the right &--right { float: right; - margin-left: .35em; + margin-left: 0.35em; } // Badge icon diff --git a/src/templates/assets/stylesheets/main/components/_footer.scss b/src/templates/assets/stylesheets/main/components/_footer.scss index 04a1eae53..9fabc05b5 100644 --- a/src/templates/assets/stylesheets/main/components/_footer.scss +++ b/src/templates/assets/stylesheets/main/components/_footer.scss @@ -79,7 +79,7 @@ flex-shrink: 0; // Hide footer title - .md-footer__title { + .md-footer__title { display: none; } } diff --git a/src/templates/assets/stylesheets/main/components/_search.scss b/src/templates/assets/stylesheets/main/components/_search.scss index 21ecf0744..e0f36b0cc 100644 --- a/src/templates/assets/stylesheets/main/components/_search.scss +++ b/src/templates/assets/stylesheets/main/components/_search.scss @@ -370,7 +370,7 @@ } // Show buttons when search is active and input non-empty - [data-md-toggle="search"]:checked ~ .md-header + [data-md-toggle="search"]:checked ~ .md-header // stylelint-disable-line .md-search__input:valid ~ & { pointer-events: initial; opacity: 1; diff --git a/src/templates/assets/stylesheets/palette/_scheme.scss b/src/templates/assets/stylesheets/palette/_scheme.scss index ee535a10c..0a9f9823e 100644 --- a/src/templates/assets/stylesheets/palette/_scheme.scss +++ b/src/templates/assets/stylesheets/palette/_scheme.scss @@ -86,7 +86,7 @@ // Footer color shades --md-footer-bg-color: hsla(var(--md-hue), 15%, 10%, 0.87); - --md-footer-bg-color--dark: hsla(var(--md-hue), 15%, 8%, 1); + --md-footer-bg-color--dark: hsla(var(--md-hue), 15%, 8%, 1); // Shadow depth 1 --md-shadow-z1: