-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstylelint.config.cjs
More file actions
94 lines (90 loc) · 3.16 KB
/
stylelint.config.cjs
File metadata and controls
94 lines (90 loc) · 3.16 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
/**
* Root Stylelint configuration for the design-system-toolkit monorepo
*
* This configuration provides shared SCSS linting rules across all packages
* that contain SCSS files (toolkit, site, react-components).
*
* Note: Stylelint v15+ removed stylistic rules. Use Prettier for code formatting.
* This config focuses on error prevention and best practices only.
*
* Packages can extend this config in their own stylelint.config.cjs:
* ```js
* module.exports = {
* extends: '../../stylelint.config.cjs',
* rules: { your overrides }
* };
* ```
*
* Ignored globs should be specified in each package's .stylelintignore file.
*/
module.exports = {
plugins: [
'stylelint-order',
'stylelint-scss',
],
extends: [
'stylelint-config-standard-scss',
],
rules: {
// Order of elements - enforce consistent structure
'order/order': [
{
'type': 'at-rule',
'name': 'extend',
},
{
'type': 'at-rule',
'name': 'mixin',
},
'declarations',
'rules',
],
'order/properties-alphabetical-order': true,
// Disallows - enforce best practices
'color-no-hex': true, // Use variables, not hex values
'color-named': 'never', // Use variables, not named colors
'at-rule-disallowed-list': ['debug', 'warn'],
'declaration-block-no-duplicate-properties': [
true,
{ ignore: ['consecutive-duplicates-with-different-values'] }, // Permit fallbacks
],
'block-no-empty': true,
'selector-max-id': 0, // No ID selectors
'declaration-no-important': true, // No !important
'color-no-invalid-hex': true,
'no-duplicate-selectors': true,
'property-no-unknown': true,
'declaration-property-value-disallowed-list': {
'transition': ['all'],
'/^border/': ['none'], // Use 'border: 0' not 'border: none'
},
'selector-no-qualifying-type': true,
// SCSS-specific rules
'scss/load-partial-extension': 'never', // Renamed from at-import-partial-extension
'scss/load-no-partial-leading-underscore': true, // Renamed from at-import-no-partial-leading-underscore
'scss/at-import-partial-extension': null, // Deprecated rule - disable warning
'scss/at-import-no-partial-leading-underscore': null, // Deprecated rule - disable warning
// Name Formats - enforce lowercase kebab-case
'scss/at-function-pattern': '^[-_a-z]+$',
'scss/at-mixin-pattern': '^[-_a-z]+$',
'scss/percent-placeholder-pattern': '^[-_a-z]+$',
'selector-class-pattern': '^[-._a-z0-9]+$',
'scss/dollar-variable-pattern': '^[-_a-z0-9]+$',
// Other
'no-descending-specificity': null,
'selector-pseudo-class-no-unknown': [true, {
'ignorePseudoClasses': ['input-placeholder'],
}],
'selector-pseudo-element-no-unknown': [true, {
'ignorePseudoElements': ['input-placeholder'],
}],
'alpha-value-notation': null,
'number-max-precision': null,
'scss/at-mixin-argumentless-call-parentheses': null,
'selector-no-vendor-prefix': null,
'value-keyword-case': null,
'scss/function-unquote-no-unquoted-strings-inside': null,
'scss/no-global-function-names': null,
'property-no-vendor-prefix': null,
},
};