-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathstylelint.node_cli.txt
302 lines (243 loc) · 20.5 KB
/
stylelint.node_cli.txt
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
┏━━━━━━━━━━━━━━━┓
┃ STYLELINT ┃
┗━━━━━━━━━━━━━━━┛
VERSION ==> #5.1.0
#CSS/Sass/Less linter.
ALTERNATIVES ==> #Those CSS linters are complementary:
# - csslint: best for errors
# - stylelint: best for CSS linting
# - scss-lint: best for Sass linting
#Rules that should prefer another linter are indicated by:
C# - csslint
T# - stylelint
S# - scss-lint
CONFIG ==> #Can be:
# - [../...]./.stylelintrc CONF_FILE:
# - JSON, YAML or Node.js module (FILE or 'MODULE')
# - stylelint --config CONF_FILE
# - OPTS.configFile CONF_FILE
# - OPTS.config CONF
# - package.json stylelint property
CONFIG.extends #CONF_FILE[_ARR]: use default. First one has priority.
#Can also use OPTS.configOverrides
#Can find many in npm using keyword "stylelint-config"
CONFIG.ignoreFiles #"GLOB"
#Relative paths to: CONFIG.configBaseDir, config dir or current dir.
RULES ==> #Can be:
# - CONFIG.rules.RULE
# - /* stylelint-disable [RULE,...] */ to /* stylelint-enable */
# - /* stylelint-disable-line [RULE,...] */
CONFIG.rules.RULE #Can be: RULE_VAL, [RULE_VAL, RULE_OPTS] or null (turn off)
#Def: null for all RULE
#RULE_OPTS:
# - severity 'warning' or 'error' (def)
# - message STR: custom error message
#RULE_VAL can be suffixed with -multi|single-line, which means rules only
#applies on multi|single lines.
CONFIG.plugins #FILE|'MODULE' defining custom RULE
stylelint [FILE|DIR|"GLOB"]... #Def: stdin
#Exit codes: 0 (success), 1 (unknown error), 2 (lint error), 78 (config file error),
#80 (globbing error)
--syntax scss|less|js #Allows working with Sass, Less or CSS in JavaScript.
#Might need to install a PostCSS plugin.
--formatter string|json #
--custom-formatter FILE #Node.js module exporting a FORMATTER
--quiet #Only shows errors
--verbose #
STYLELINT.lint(OPTS)->PROMISE(OBJ) #OPTS:
# - code 'CSS'
# - files STR_ARR: passed to node-glob
# - syntax STR
# - formatter 'string|json'|FUNC(OBJ_ARR)->STR
# - configBaseDir: DIR used for CONFIG.extends|plugins
#OBJ:
# - output STR
# - errored BOOL
# - results OBJ_ARR
# - postcssResults OBJ: returned by POSTCSS.process()
FORMATTER ==> #FUNC(OBJ_ARR)->STR, where OBJ_ARR:
# - source 'FILE'
# - errored BOOL
# - warnings OBJ_ARR:
# - line|column NUM
# - rule 'RULE'
# - text STR
# - severity 'warning|error'
# - deprecations OBJ_ARR:
# - text STR
# - reference 'URL'
# - invalidOptionWarnings OBJ_ARR: text STR
CUSTOM RULE ==> #See online doc (for both normal rules and plugins)
┌────────────┐
│ ERRORS │
└────────────┘
string-no-newline #BOOL. No unescaped newline inside STR
color-no-invalid-hex #BOOL. No syntax error in hex color
media-feature-no-missing-punctuation #BOOL. Syntax error in @media
property-unknown S##BOOL. No unknown property
S##Ignores -PROP and $VAR|@VAR
S##Plugin: stylelint-property-unknown (1.0.0)
no-duplicate-selectors #BOOL. No duplicate selectors
declaration-block-no-duplicate-properties #BOOL. No duplicate properties
declaration-block-no-shorthand-property-overrides #BOOL. No shorthand property after a related longer property,
#e.g. background after background-repeat
block-no-empty #BOOL. No empty blocks
no-unknown-animations #BOOL. No @animations pointing to unknown animations
no-unsupported-browser-features #BOOL. No features unsupported by target browsers (using doiuse)
#RULE_OPTS:
# - browsers BROWSERS
# - ignore 'FEATURE_NAME'_ARR
┌──────────────────┐
│ NON-STANDARD │
└──────────────────┘
selector|at-rule|media-feature-name|property|
value-no-vendor-prefix #BOOL. Do not use vendor prefixes on SELECTOR|@RULE|FEATURE|PROP|values
function-linear-gradient-no-nonstandard-direction #BOOL. Do not use linear-gradient(DIRECTION ...) (use "to DIRECTION" instead)
no-browser-hacks #BOOL
#RULE_OPTS:
# - browsers BROWSERS (see browserslist)
┌─────────────┐
│ NEWLINE │
└─────────────┘
max-empty-lines #NUM
rule-[non-]nested-empty-line-before #Newline before nested|normal rulesets: 'always|never[-multi-line]'
comment-empty-line-before #Newline before comment: 'always|never'
at-rule-empty-line-before #Newline before @RULE: 'always|never'
at-rule-semicolon-newline-before #Newline after @RULE: 'always|never'
no-missing-eof-newline #BOOL. Newline at end of file
block-opening|closing-brace-newline-after|before #Newline after|before { or } 'always|never[-single|multi-line]'
declaration-block-single-line-max-declarations #Do not require newline around { } if ruleset has <=NUM rules
block-no-single-line #BOOL. No single-line rulesets
selector-list-comma-newline-before|after #Newline after|before , in selectors: 'always|never[-multi-line]'
media-query-list-comma-newline-after|before #Newline after|before , in @media: 'always|never[-multi-line]'
declaration-block-semicolon-newline-after|before #Newline after|before ; 'always|never[-multi-line]'
declaration-colon-newline-after #Newline after : 'always[-multi-line]'
value-list-comma-newline-after|before #Newline after|before , in values: 'always|never[-multi-line]'
function-comma-newline-after|before #Newline after|before , inside functions: 'always|never[-multi-line]'
function-parentheses-newline-inside #Newline after ( and before ) inside functions: 'always|never[-multi-line]'
declaration-block-trailing-semicolon #BOOL. ; for the last rule of a ruleset: 'always|never'
┌──────────────────┐
│ INDENT/WIDTH │
└──────────────────┘
indentation #Indentation: 'tab'|NUM
#RULE_OPTS:
# - except STR_ARR: do not indent 'block' (ruleset), 'param' (PROP), 'value'
# - ignore STR_ARR: same but ignore
# - hierarchicalSelectors BOOL: if true (def: false), should indent a ruleset if
# the former ruleset is related, e.g.:
# - .CLASS then .CLASS-CLASS2
# - SELECTOR then SELECTOR > SELECTOR2
max-line-length #NUM
#RULE_OPTS:
# - ignore STR_ARR: 'non-comments': only apply it to comments, and only to comments on their own line
┌───────────┐
│ SPACE │
└───────────┘
no-eol-whitespace #BOOL. No trailing whitespace
comment-whitespace-inside #Space inside /* */: 'always|never'
selector-list-comma-space-after|before #Space after|before , in selectors: 'always|never[-single-line]'
selector-combinator-space-after|before #Space after|before > + ~ 'always|never'
block-opening|closing-brace-space-after|before #Space after|before { or } 'always|never[-single|multi-line]'
media-query-parentheses-space-inside #Space after ( and before ) in @media: 'always|never'
media-query-list-comma-space-after|before #Space after|before , in @media: 'always|never[-single-line]'
media-feature-colon-space-after|before #Space after|before : in @media: 'always|never'
media-feature-range-operator-space-after|before #Space after|before < <= > >= in @media: 'always|never'
declaration-block-semicolon-space-after|before #Space after|before ; 'always|never[-single-line]'
declaration-colon-space-after|before #Space after|before : 'always|never[-single-line]'
value-list-comma-space-after|before #Space after|before , in values: 'always|never[-single-line]'
function-comma-space-after|before #Space after|before , inside functions: 'always|never[-single-line]'
function-space-newline-inside #Space after ( and before ) inside functions: 'always|never[-single-line]'
function-whitespace-after #Space after FUNC(): 'always|never'
function-calc-no-unspaced-operator #BOOL. Space around operators inside calc()
declaration-bang-space-after|before #Space after|before !: 'always|never'
┌──────────────┐
│ COMMENTS │
└──────────────┘
no-invalid-double-slash-comments #BOOL. /* COMMENT */, not // COMMENT, unless using Sass/Less
stylelint-disable-reason #Comment 'always-before|after' /* stylelint-disable */
┌───────────────┐
│ SELECTORS │
└───────────────┘
selector-class|id-pattern #.CLASS REGEXP (without .) or #ID (without #)
#RULE_OPTS:
# - resolveNestedSelectors BOOL: if true (def: false), resolve &
selector-bem-pattern ##.CLASS follows BEM naming scheme
##OBJ are same as postcss-bem-linter options
##Plugin: stylelint-selector-bem-pattern (0.2.3)
selector-type-case #TAG selectors case: 'lower|upper'
selector-pseudo-element-colon-notation #::PSEUDO or :PSEUDO: 'single|double'
selector-no-universal #No * selectors
selector-no-id #No #ID selectors
selector-no-type #No TAG selectors
selector-no-attribute #No [ATTR...] selectors
selector-no-combinator #No > + ~ combinators
selector-max-specificity #Max specificity as 'NUM,NUM2,NUM3'
no-descending-specificity #BOOL. If true, related rulesets must start with least specific.
declaration-no-important #BOOL. No !important
max-nesting-depth #NUM
#RULE_OPTS:
# - ignore STR_ARR: 'at-rules': ignore @RULE { SELECTOR { PROP ... } } but not @RULE { PROP ...}
┌───────────┐
│ PROPS │
└───────────┘
declaration-block-properties-order S#PROPS order:
S# - 'alphabetical'
S# - ARR of:
S# - GROUP:
S# - properties 'PROP'_ARR
S# PROP will match PROP[-*]
S# - order: whether properties should follow 'PROP'_ARR order: 'strict' (def) or 'flexible'
S# - emptyLineBefore 'always' or 'never' (def)
S# - 'PROP': same as { properties: ['PROP'] }
S#When using ARR, unspecified PROP is according to RULE_OPTS.unspecified:
S# - 'ignore': anywhere
S# - 'top|bottom'
S# - 'bottomAlphabetical'
S#Ignore Sass/Less/CSS variables and mixins/etc.
property-whitelist|blacklist #'PROP'_ARR to whitelist|blacklist
function-whitelist|blacklist #'FUNC'_ARR to whitelist|blacklist
┌────────────┐
│ VALUES │
└────────────┘
property-value-whitelist|blacklist #{ PROP|'PROP_REGEXP': STR_ARR ... } of values to whitelist|blacklist
font-weight-notation #Using keywords in font-weight: 'numeric|named-where-possible'
#RULE_OPTS:
# - ignore STR_ARR: 'relative': ignore lighter|bolder
color-no-hex #BOOL. No hex color
color-hex-case #COLOR case: 'lower|upper'
color-hex-length #COLOR: as 'short|long' as possible
color-named #COLOR names: 'always-where-possible|never'
no-indistinguishable-colors #BOOL. Disallow very close colors
#RULE_OPTS:
# - threshold 0-100 (def: 3)
# - ignore COLOR_ARR: whitelist single color
# - whitelist [COLOR,COLOR2]_ARR: whitelist color pairs
number-zero-length-no-unit #BOOL: unitless 0, for LEN
number-leading-zero #0.5 (not .5): 'always|never'
number-max-precision #NUM
number-no-trailing-zeros #BOOL
unit-whitelist|blacklist #STR_ARR of units to whitelist|blacklist
property-unit-whitelist|blacklist #Same but as { PROP|'PROP_REGEXP': STR_ARR ... }
time-no-imperceptible #BOOL. Disallow animations|transitions under 100ms
┌────────────┐
│ QUOTES │
└────────────┘
string-quotes #Quotes around STR: 'single|double'
function-url-quotes #Quotes inside url(): 'single|double|none'
font-family-name-quotes #Quotes around font-family value:
# - "single|double-where-required": not around keyword or name that requires escaping
# - "single|double-where-recommended": not around keyword or name that requires whitespace,
# non-hyphen-punctuation or digit
# - "single|double-unless-keyword": not around keyword
#Does not work with Sass/Less/CSS variables
┌────────────┐
│ @MEDIA │
└────────────┘
custom-media-pattern #@media --MEDIA REGEXP (without --)
┌───────────────┐
│ VARIABLES │
└───────────────┘
custom-property-no-outside-root #BOOL. Custom variables must be inside :root { ... }
root-no-standard-properties #BOOL. Only custom variables inside :root { ... }
selector-root-no-composition #:root cannot be with other selector
custom-property-pattern #REGEXP. Custom variables names, without --