-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.stylelintrc.yml
165 lines (138 loc) Β· 4.18 KB
/
.stylelintrc.yml
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
extends:
- stylelint-config-recess-order
- stylelint-config-standard-scss
plugins:
# TODO: stylelint-a11y
# https://github.com/developer-stylechain/stylelint-a11y
- stylelint-plugin-defensive-css
# Default rules
# See: https://stylelint.io/user-guide/rules/
rules:
# Use a number instead of percentage for alpha values
alpha-value-notation: number
# Require empty line before @rule, with exceptions
at-rule-empty-line-before:
- always
- ignore:
- after-comment
- blockless-after-same-name-blockless
- inside-block
# Required properties
at-rule-property-required-list:
font-face:
- font-display
- font-family
- font-style
# Don't use comma-free syntax for color functions
color-function-notation: legacy
# Color keywords are actually bad at describing the color they represent
color-named: never
# Hexadecimal is close to indecipherable for the human mind
color-no-hex: true
# "TODO" and "FIXME" warnings act as a reminder to address these
comment-word-disallowed-list:
- ["/^TODO:/", "/^FIXME:/"]
- message: This part of the code should be addressed.
severity: warning
# kebab-case with BEM-like dashes
custom-property-pattern:
- "^([a-z][a-z0-9]*)(\\-\\-?[a-z0-9]+)*$"
- message: Property should be in kebab-case with optional BEM-like dashes.
# Disallow empty lines before declarations, with exceptions
declaration-empty-line-before:
- never
- ignore:
- after-declaration
# Disallow !important
declaration-no-important:
- true
- message: Avoid !important property.
severity: warning
# Property and value pairs blacklist
declaration-property-value-disallowed-list:
- # Prefer 0 over none
border:
- "none"
margin:
- "none"
padding:
- "none"
# Don't use custom cursors
# https://ericwbailey.website/published/dont-use-custom-css-mouse-cursors/
cursor:
- "/^url/"
# Require font names to be quoted unless it's a keyword
# See: https://stylelint.io/user-guide/rules/font-family-name-quotes/#options
font-family-name-quotes: always-unless-keyword
# Use numbers for font weight instead of names
font-weight-notation: numeric
# Functions blacklist
function-disallowed-list:
# rgba() only
- rgb
# Disallow scheme-relative URLs
function-url-no-scheme-relative: true
# URL scheme blacklist
function-url-scheme-disallowed-list:
- "/^\\./"
- "/^\\.\\.\\//"
- http
- data
- ftp
# Limit the number of decimal places allowed in numbers
number-max-precision: 3
# Require an empty line before every rule
# except after comments or nested rules
rule-empty-line-before:
- always
- ignore:
- after-comment
- inside-block
# kebab-case with BEM-like underscores
selector-class-pattern:
- "^([a-z][a-z0-9]*)(((\\_\\_)?|\\-)[a-z0-9]+)*$"
- message: Selector should be kebab-case with optional BEM-like underscores.
# Selector blacklist
selector-disallowed-list:
- "/h5/"
- "/h6/"
# Units blacklist, with exceptions
unit-disallowed-list:
- [ms, pt, px]
- ignoreFunctions:
- px2em
- px2rem
ignoreProperties:
px:
- border
- border-bottom
- border-radius
- border-top
- bottom
- box-shadow
- font-size
- left
- right
- text-shadow
- top
# Lowercase keywords, with exceptions
value-keyword-case:
- lower
- ignoreKeywords:
- currentColor
# SCSS rules
# See: https://github.com/stylelint-scss/stylelint-scss/tree/master/src/rules
# Allow multiple spaces after $variable
scss/dollar-variable-colon-space-after: at-least-one-space
# Require empty line before comments, with exceptions
scss/double-slash-comment-empty-line-before:
- always
- ignore: [between-comments, inside-block, stylelint-commands]
# Plugin: Defensive CSS
# See: https://github.com/yuschick/stylelint-plugin-defensive-css
plugin/use-defensive-css:
- true
- background-repeat: true
flex-wrapping: true
scroll-chaining: true
vendor-prefix-grouping: true