-
Notifications
You must be signed in to change notification settings - Fork 0
/
stylelint.config.js
111 lines (110 loc) · 3.49 KB
/
stylelint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
module.exports = {
extends: [
"stylelint-config-standard",
"stylelint-config-recommended",
"stylelint-config-prettier",
"stylelint-config-sass-guidelines",
"stylelint-config-standard",
],
failOnError: true,
files: ["assets/**/*.{s?(a|c)ss,less,stylus}", "{components,layouts,pages}/**/*.vue"],
plugins: ["stylelint-scss"],
ignoreFiles: [
"./coverage/**/*",
"./dist/**/*",
"./node_modules/**/*",
"./src/**/__snapshots__/**/*",
"./static/*",
"./assets/images/*",
"./assets/json/*",
"./assets/css/**/*",
"./public/*",
"./*",
],
rules: {
"max-nesting-depth": [
4,
{
ignore: ["blockless-at-rules", "pseudo-classes"],
},
],
"selector-max-compound-selectors": 7,
"selector-max-id": 1,
"selector-no-qualifying-type": null,
"selector-pseudo-element-colon-notation": null,
"color-named": null,
// Enforce BEM class patterns, inspired by
// - https://github.com/simonsmith/stylelint-selector-bem-pattern/issues/23#issuecomment-279216443
// - https://github.com/bjankord/stylelint-config-sass-guidelines/issues/20#issuecomment-349972873
// probably it can be achieved with them too:
// - https://github.com/simonsmith/stylelint-selector-bem-pattern
// - https://github.com/postcss/postcss-bem-linter
"selector-class-pattern":
"^(?:(?:o|c|u|t|s|is|has|_|js|qa)-)?[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*(?:__[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:--[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:\\[.+\\])?$",
"function-name-case": null,
"no-descending-specificity": null,
"font-family-no-missing-generic-family-keyword": null,
"at-rule-empty-line-before": null,
"at-rule-no-unknown": [
true,
{
ignoreAtRules: ["include", "each", "mixin", "extend", "if", "function", "for", "else", "return", "screen"],
},
],
"property-no-unknown": [
true,
{
ignoreProperties: [/box-orient/],
},
],
"selector-type-no-unknown": [true],
"selector-pseudo-element-no-unknown": [
true,
{
ignorePseudoElements: ["v-deep"],
},
],
"unit-no-unknown": [
true,
{
ignoreFunctions: ["-webkit-image-set"],
},
],
"property-no-vendor-prefix": [
true,
{
ignoreProperties: ["box-orient"],
},
],
"value-no-vendor-prefix": [
true,
{
ignoreValues: ["box"],
},
],
// stylelint-config-sass-guidelines requires
// you to omit the '.scss' ending in @import statements. But in combination
// with webpack we still need it.
"scss/at-import-partial-extension-blacklist": null,
"scss/at-extend-no-missing-placeholder": null,
"scss/at-function-pattern": "^[a-zA-Z]+([a-zA-Z0-9-]+[a-zA-Z0-9]+)?$",
"scss/at-import-no-partial-leading-underscore": null,
"scss/at-mixin-pattern": "^[a-z]+([a-z0-9-]+[a-z0-9]+)?$",
"scss/at-rule-no-unknown": [
true,
{
ignoreAtRules: ["screen"],
},
],
"scss/dollar-variable-colon-space-after": "always",
"scss/dollar-variable-colon-space-before": "never",
"scss/dollar-variable-pattern": "^[_]?[a-zA-Z]+([a-z0-9-]+[a-z0-9]+)?$",
"scss/percent-placeholder-pattern": "^[a-z]+([a-z0-9-]+[a-z0-9]+)?$",
"scss/selector-no-redundant-nesting-selector": null,
"declaration-colon-newline-after": null,
"declaration-block-trailing-semicolon": null,
"value-list-comma-newline-after": null,
"no-eol-whitespace": null,
"string-quotes": "double",
},
};