From dab29bdfe0285d4fc7bfc49e0c8beae203cb9c88 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Wed, 25 Nov 2020 13:57:01 -0500 Subject: [PATCH] Add stylelint for sass files --- .stylelintrc => .stylelintrc.json | 30 +++++++++++++++--------------- .stylelintrc.scss.json | 8 ++++++++ package.json | 5 ++++- yarn.lock | Bin 414039 -> 414511 bytes 4 files changed, 27 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 1da117089b85cfdf309bca0541df9c0f6eee904c..f70ccde5c90fdfa24c489f65aad9775009d66f1b 100644 GIT binary patch delta 270 zcmcbF7M3lnd>wMS#mU9R4sphMh8B7TR$K}SWvNBQnfZANN+6-> zj!LY0(`s2+rZ=>*vburP>g(zkmsIAY=49rTfHmtv^y-zQS1DVh8JHQH8zvhW8Cx1y zCZ!ptnHi;87+ac}SR|$yCMBk%rluHApYWJfBGkvlTsxyo-%Q`Jz|XzJTstpF-_#(j z#5_5*$~(Zw!`HOP(;~6VGsQhIG`uL)xFW|REzBg#+h5-$C@P~kIjz)B+qJyX(#)72-jYELhi#Hur0pofKHdVwPg=X5(G78PbgJ%jB` I9ju`z0YTtXSO5S3 delta 25 hcmZ3#O!E37$%Yoj7N!>F7M3lnd>z}Lb+US%1OSCx3MT*n