-
Notifications
You must be signed in to change notification settings - Fork 1
/
stylelint.config.js
178 lines (176 loc) · 5.96 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
// https://stylelint.io/user-guide/rules/
module.exports = {
plugins: ['stylelint-scss', 'stylelint-declaration-strict-value'],
extends: ['stylelint-config-standard-scss'],
rules: {
/* disable unnecessary rules from recommended extends */
'function-no-unknown': null,
'at-rule-no-unknown': null,
'no-empty-first-line': null,
'selector-class-pattern': null,
'function-name-case': null,
'selector-no-vendor-prefix': null,
'custom-property-empty-line-before': null,
'no-empty-source': null,
'scss/at-else-empty-line-before': null,
'scss/at-if-closing-brace-space-after': null,
'scss/at-if-closing-brace-newline-after': null,
'scss/at-else-closing-brace-newline-after': null,
'scss/at-else-closing-brace-space-after': null,
'declaration-colon-newline-after': null,
'scss/at-function-pattern': null,
'scss/at-rule-no-unknown': null,
'scss/selector-no-redundant-nesting-selector': null,
'max-nesting-depth': null,
'color-no-invalid-hex': [true, { severity: 'warning' }],
'font-family-no-duplicate-names': [true, { severity: 'warning' }],
'font-family-no-missing-generic-family-keyword': [
true,
{ severity: 'warning' },
],
'function-calc-no-unspaced-operator': [true, { severity: 'warning' }],
'function-linear-gradient-no-nonstandard-direction': [
true,
{ severity: 'warning' },
],
'string-no-newline': [true, { severity: 'warning' }],
'unit-no-unknown': [true, { severity: 'warning' }],
'property-no-unknown': [
true,
{
severity: 'warning',
checkPrefixed: true,
},
],
'keyframe-declaration-no-important': [true, { severity: 'warning' }],
'declaration-block-no-duplicate-properties': [
true,
{ severity: 'warning' },
],
'declaration-block-no-shorthand-property-overrides': [
true,
{ severity: 'warning' },
],
'block-no-empty': [true, { severity: 'warning' }],
'selector-type-no-unknown': [true, { severity: 'warning' }],
'media-feature-name-no-unknown': [true, { severity: 'warning' }],
'comment-no-empty': [true, { severity: 'warning' }],
'no-duplicate-at-import-rules': [true, { severity: 'warning' }],
'number-max-precision': [6, { severity: 'warning' }],
'time-min-milliseconds': [100, { severity: 'warning' }],
'unit-disallowed-list': [
['px', 'cm', 'mm', 'pt', 'in', 'pc'],
{
severity: 'warning',
/**
* it's not working with '["px", "dpi"]' syntax
* as in example in the docs
* so we need to use this hack with regex.
*/
ignoreMediaFeatureNames: {
px: [/a-zA-Z0-9/],
dpi: [/a-zA-Z0-9/],
},
/**
* allow to use 'px' and 'dpi' in variables that has prefix 'media-'
*
* we need to use "." (dot) at the beginning of the regex to prevent
* handle variables values because linter doesn't read '$' value in the
* "/^\$media-/" regex, so we try not to match the first character
*/
ignoreProperties: {
px: ['/^.media-/'],
dpi: ['/^.media-/'],
},
},
],
'shorthand-property-no-redundant-values': [true, { severity: 'warning' }],
'value-no-vendor-prefix': [
true,
{
severity: 'warning',
ignoreValues: ['inline-box'],
},
],
'property-no-vendor-prefix': [
true,
{
severity: 'warning',
ignoreProperties: [
'background-clip',
'box-decoration-break',
'box-orient',
'transition-property',
'appearance',
],
},
],
'declaration-block-no-redundant-longhand-properties': [
true,
{ severity: 'warning' },
],
'declaration-no-important': [true, { severity: 'warning' }],
'declaration-block-single-line-max-declarations': [
1,
{ severity: 'warning' },
],
'at-rule-no-vendor-prefix': [true, { severity: 'warning' }],
'no-unknown-animations': [true, { severity: 'warning' }],
'color-hex-length': ['long', { severity: 'warning' }],
'font-family-name-quotes': [
'always-unless-keyword',
{ severity: 'warning' },
],
'font-weight-notation': ['numeric', { severity: 'warning' }],
'function-url-quotes': ['always', { severity: 'warning' }],
'length-zero-no-unit': [true, { severity: 'warning' }],
'value-keyword-case': ['lower', { severity: 'warning' }],
'selector-attribute-quotes': ['always', { severity: 'warning' }],
'selector-pseudo-element-colon-notation': [
'single',
{ severity: 'warning' },
],
'selector-type-case': ['lower', { severity: 'warning' }],
'rule-empty-line-before': [
'always-multi-line',
{
severity: 'warning',
ignore: ['after-comment', 'first-nested'],
},
],
'at-rule-empty-line-before': [
'always',
{
severity: 'warning',
ignore: ['after-comment', 'first-nested'],
},
],
'comment-whitespace-inside': ['always', { severity: 'warning' }],
/**
* disallow to use defined properties without variables
*/
'scale-unlimited/declaration-strict-value': [
['/color/', 'z-index', 'fill', 'stroke'],
{
ignoreFunctions: false,
ignoreKeywords: {
// '' means default, for all
'': ['currentColor', 'transparent', 'inherit', 'initial'],
fill: ['none'],
stroke: ['none'],
},
},
],
'selector-pseudo-class-no-unknown': [true, { severity: 'warning' }],
'selector-pseudo-element-no-unknown': [
true,
{ ignorePseudoElements: ['v-deep', 'v-global'], severity: 'warning' },
],
'no-duplicate-selectors': [true, { severity: 'warning' }],
'no-descending-specificity': [true, { severity: 'warning' }],
'color-function-notation': 'legacy',
'scss/at-mixin-parentheses-space-before': 'always',
'alpha-value-notation': 'number',
'selector-not-notation': 'simple',
},
}