-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Expand file tree
/
Copy path.stylelintrc.js
More file actions
116 lines (116 loc) · 3.27 KB
/
.stylelintrc.js
File metadata and controls
116 lines (116 loc) · 3.27 KB
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
/** @type {import('stylelint').Config} */
module.exports = {
extends: '@wordpress/stylelint-config/scss-stylistic',
plugins: [
'stylelint-plugin-logical-css',
'@wordpress/theme/stylelint-plugins/no-token-fallback-values',
],
rules: {
'at-rule-empty-line-before': null,
'at-rule-no-unknown': null,
'comment-empty-line-before': null,
'declaration-property-value-allowed-list': [
{
'flex-direction': '/^(?!(row|column)-reverse).*$/',
},
{
message: ( property, value ) =>
`Avoid "${ value }" value for the "${ property }" property. For accessibility reasons, visual, reading, and DOM order must match. Only use the reverse values when they do not affect reading order, meaning, and interaction.`,
},
],
'declaration-property-value-disallowed-list': [
{
'/.*/': [ '/--wp-components-color-/' ],
},
{
message: ( property, value ) =>
`Avoid using "${ value }" in "${ property }". --wp-components-color-* variables are not ready to be used outside of the components package.`,
},
],
'font-weight-notation': null,
'@stylistic/max-line-length': null,
'no-descending-specificity': null,
'property-disallowed-list': [
[ 'order' ],
{
message:
'Avoid the order property. For accessibility reasons, visual, reading, and DOM order must match. Only use the order property when it does not affect reading order, meaning, and interaction.',
},
],
'rule-empty-line-before': null,
'selector-class-pattern': null,
'value-keyword-case': null,
'scss/operator-no-unspaced': null,
'scss/selector-no-redundant-nesting-selector': null,
'scss/load-partial-extension': null,
'scss/no-global-function-names': null,
'scss/comment-no-empty': null,
'scss/at-extend-no-missing-placeholder': null,
'scss/operator-no-newline-after': null,
'scss/at-if-closing-brace-newline-after': null,
'scss/at-else-empty-line-before': null,
'scss/at-if-closing-brace-space-after': null,
'no-invalid-position-at-import-rule': null,
'plugin-wpds/no-token-fallback-values': true,
},
overrides: [
{
files: [ '**/*.module.css' ],
rules: {
'function-no-unknown': [
true,
{
ignoreFunctions: [
// CSS stepped value math functions in Baseline 2024.
// This rule exception can likely be removed when
// updating to a more recent version of Stylelint.
'round',
'rem',
'mod',
],
},
],
'declaration-property-max-values': {
// Prevents left/right values with shorthand property names (unclear for RTL)
margin: 3,
padding: 3,
'border-width': 3,
'border-color': 3,
'border-style': 3,
'border-radius': 3,
inset: 3,
},
'plugin/use-logical-properties-and-values': [
true,
{
ignore: [
// Doesn't affect RTL styles
'width',
'min-width',
'max-width',
'height',
'min-height',
'max-height',
'margin-top',
'margin-bottom',
'padding-top',
'padding-bottom',
'top',
'bottom',
],
},
],
'property-no-unknown': [
true,
{
ignoreProperties: [
// https://github.com/css-modules/css-modules/blob/master/docs/composition.md
'composes',
],
},
],
},
},
],
reportDescriptionlessDisables: true,
};