From dab29bdfe0285d4fc7bfc49e0c8beae203cb9c88 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Wed, 25 Nov 2020 13:57:01 -0500 Subject: [PATCH 1/2] Add stylelint for sass files --- .stylelintrc => .stylelintrc.json | 30 +++++++++++++++--------------- .stylelintrc.scss.json | 8 ++++++++ package.json | 5 ++++- yarn.lock | 11 +++++++++++ 4 files changed, 38 insertions(+), 16 deletions(-) rename .stylelintrc => .stylelintrc.json (91%) create mode 100644 .stylelintrc.scss.json diff --git a/.stylelintrc b/.stylelintrc.json similarity index 91% rename from .stylelintrc rename to .stylelintrc.json index a13acf428d..0f059233d5 100644 --- a/.stylelintrc +++ b/.stylelintrc.json @@ -1,14 +1,14 @@ { "plugins": [ - "stylelint-no-browser-hacks/lib", + "stylelint-no-browser-hacks/lib" ], "rules": { "at-rule-empty-line-before": [ "always", { - except: [ + "except": [ "blockless-after-same-name-blockless", - "first-nested", + "first-nested" ], - ignore: ["after-comment"], + "ignore": ["after-comment"] } ], "at-rule-name-case": "lower", "at-rule-name-space-after": "always-single-line", @@ -26,27 +26,27 @@ "color-hex-length": "short", "color-no-invalid-hex": true, "comment-empty-line-before": [ "always", { - except: ["first-nested"], - ignore: ["stylelint-commands"], + "except": ["first-nested"], + "ignore": ["stylelint-commands"] } ], "comment-no-empty": true, "comment-whitespace-inside": "always", "custom-property-empty-line-before": [ "always", { - except: [ + "except": [ "after-custom-property", - "first-nested", + "first-nested" ], - ignore: [ + "ignore": [ "after-comment", - "inside-single-line-block", - ], + "inside-single-line-block" + ] } ], "declaration-bang-space-after": "never", "declaration-bang-space-before": "always", "declaration-block-no-duplicate-properties": [ true, { - ignore: ["consecutive-duplicates-with-different-values"] + "ignore": ["consecutive-duplicates-with-different-values"] } ], "declaration-block-no-shorthand-property-overrides": true, @@ -105,8 +105,8 @@ } ], "rule-empty-line-before": [ "always-multi-line", { - except: ["first-nested"], - ignore: ["after-comment"], + "except": ["first-nested"], + "ignore": ["after-comment"] } ], "selector-attribute-brackets-space-inside": "never", "selector-attribute-operator-space-after": "never", @@ -138,6 +138,6 @@ "value-list-comma-newline-after": "always-multi-line", "value-list-comma-space-after": "always-single-line", "value-list-comma-space-before": "never", - "value-list-max-empty-lines": 0, + "value-list-max-empty-lines": 0 } } diff --git a/.stylelintrc.scss.json b/.stylelintrc.scss.json new file mode 100644 index 0000000000..7c5b0dd401 --- /dev/null +++ b/.stylelintrc.scss.json @@ -0,0 +1,8 @@ +{ + "extends": [ "./.stylelintrc.json" ], + "plugins": [ "stylelint-scss" ], + "rules": { + "at-rule-no-unknown": null, + "scss/at-rule-no-unknown": true + } +} diff --git a/package.json b/package.json index 53ae7f077f..c24639dbfc 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "stylelint-config-rational-order": "^0.1.2", "stylelint-no-browser-hacks": "^1.2.1", "stylelint-order": "^4.1.0", + "stylelint-scss": "^3.18.0", "webpack": "^5.4.0", "webpack-cli": "^4.0.0", "webpack-dev-server": "^3.11.0", @@ -112,6 +113,8 @@ "build:development": "webpack --config webpack.dev.js", "build:production": "webpack --config webpack.prod.js", "lint": "eslint \".\"", - "stylelint": "stylelint \"src/**/*.css\"" + "stylelint": "yarn stylelint:css && yarn stylelint:scss", + "stylelint:css": "stylelint \"src/**/*.css\"", + "stylelint:scss": "stylelint --config=\".stylelintrc.scss.json\" \"src/**/*.scss\"" } } diff --git a/yarn.lock b/yarn.lock index 1da117089b..f70ccde5c9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8086,6 +8086,17 @@ stylelint-order@^4.1.0: postcss "^7.0.31" postcss-sorting "^5.0.1" +stylelint-scss@^3.18.0: + version "3.18.0" + resolved "https://registry.yarnpkg.com/stylelint-scss/-/stylelint-scss-3.18.0.tgz#8f06371c223909bf3f62e839548af1badeed31e9" + integrity sha512-LD7+hv/6/ApNGt7+nR/50ft7cezKP2HM5rI8avIdGaUWre3xlHfV4jKO/DRZhscfuN+Ewy9FMhcTq0CcS0C/SA== + dependencies: + lodash "^4.17.15" + postcss-media-query-parser "^0.2.3" + postcss-resolve-nested-selector "^0.1.1" + postcss-selector-parser "^6.0.2" + postcss-value-parser "^4.1.0" + stylelint@^13.8.0: version "13.8.0" resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-13.8.0.tgz#446765dbe25e3617f819a0165956faf2563ddc23" From 7cd8fd9aa5ffa6c2dff9ee2723f044c39180c35d Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Wed, 25 Nov 2020 13:58:34 -0500 Subject: [PATCH 2/2] Fix stylelint error --- src/plugins/bookPlayer/style.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/bookPlayer/style.scss b/src/plugins/bookPlayer/style.scss index 694bb8b1e2..df96a9e5c5 100644 --- a/src/plugins/bookPlayer/style.scss +++ b/src/plugins/bookPlayer/style.scss @@ -15,7 +15,7 @@ top: 0; width: 100%; color: #000; - opacity: .7; + opacity: 0.7; } .bookPlayerContainer {