Skip to content

Commit c400653

Browse files
authored
Tweak stylelint config (#38228)
* rename to .stylelintrc.json * add reportInvalidScopeDisables to config * move reportNeedlessDisables to config * merge the two configs * remove unneeded disabled rules from the examples config
1 parent 474bf2a commit c400653

File tree

6 files changed

+63
-60
lines changed

6 files changed

+63
-60
lines changed

.stylelintrc

-40
This file was deleted.

.stylelintrc.json

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"extends": [
3+
"stylelint-config-twbs-bootstrap"
4+
],
5+
"reportInvalidScopeDisables": true,
6+
"reportNeedlessDisables": true,
7+
"overrides": [
8+
{
9+
"files": "**/*.scss",
10+
"rules": {
11+
"declaration-property-value-disallowed-list": {
12+
"border": "none",
13+
"outline": "none"
14+
},
15+
"function-disallowed-list": [
16+
"calc",
17+
"lighten",
18+
"darken"
19+
],
20+
"property-disallowed-list": [
21+
"border-radius",
22+
"border-top-left-radius",
23+
"border-top-right-radius",
24+
"border-bottom-right-radius",
25+
"border-bottom-left-radius",
26+
"transition"
27+
],
28+
"scss/dollar-variable-default": [
29+
true,
30+
{
31+
"ignore": "local"
32+
}
33+
],
34+
"scss/selector-no-union-class-name": true
35+
}
36+
},
37+
{
38+
"files": "scss/**/*.{test,spec}.scss",
39+
"rules": {
40+
"scss/dollar-variable-default": null,
41+
"declaration-no-important": null
42+
}
43+
},
44+
{
45+
"files": "site/**/*.scss",
46+
"rules": {
47+
"scss/dollar-variable-default": null
48+
}
49+
},
50+
{
51+
"files": "site/**/examples/**/*.css",
52+
"rules": {
53+
"comment-empty-line-before": null,
54+
"property-no-vendor-prefix": null,
55+
"selector-no-qualifying-type": null,
56+
"value-no-vendor-prefix": null
57+
}
58+
}
59+
]
60+
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"css-compile": "sass --style expanded --source-map --embed-sources --no-error-css scss/:dist/css/",
4646
"css-rtl": "cross-env NODE_ENV=RTL postcss --config build/postcss.config.js --dir \"dist/css\" --ext \".rtl.css\" \"dist/css/*.css\" \"!dist/css/*.min.css\" \"!dist/css/*.rtl.css\"",
4747
"css-lint": "npm-run-all --aggregate-output --continue-on-error --parallel css-lint-*",
48-
"css-lint-stylelint": "stylelint \"**/*.{css,scss}\" --cache --cache-location .cache/.stylelintcache --rd",
48+
"css-lint-stylelint": "stylelint \"**/*.{css,scss}\" --cache --cache-location .cache/.stylelintcache",
4949
"css-lint-vars": "fusv scss/ site/assets/scss/",
5050
"css-minify": "npm-run-all --aggregate-output --parallel css-minify-*",
5151
"css-minify-main": "cleancss -O1 --format breakWith=lf --with-rebase --source-map --source-map-inline-sources --output dist/css/ --batch --batch-suffix \".min\" \"dist/css/*.css\" \"!dist/css/*.min.css\" \"!dist/css/*rtl*.css\"",

site/assets/scss/_variables.scss

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// stylelint-disable scss/dollar-variable-default
2-
31
// Local docs variables
42
$bd-purple: #4c0bce;
53
$bd-violet: lighten(saturate($bd-purple, 5%), 15%); // stylelint-disable-line function-disallowed-list

site/assets/scss/docs.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
@import "../../../scss/mixins";
2929

3030
// fusv-disable
31-
$enable-grid-classes: false; // stylelint-disable-line scss/dollar-variable-default
32-
$enable-cssgrid: true; // stylelint-disable-line scss/dollar-variable-default
31+
$enable-grid-classes: false;
32+
$enable-cssgrid: true;
3333
// fusv-enable
3434
@import "../../../scss/grid";
3535

site/content/docs/5.3/examples/.stylelintrc

-15
This file was deleted.

0 commit comments

Comments
 (0)