This repository has been archived by the owner on Jan 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstylelint.config.js
97 lines (89 loc) · 3.25 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
module.exports = {
customSyntax: "postcss-html",
extends: [
"stylelint-config-recommended",
"stylelint-8-point-grid", // https://github.com/dcrtantuco/stylelint-8-point-grid
// Enforce a standard order for CSS properties
// https://github.com/stormwarning/stylelint-config-recess-order
"stylelint-config-recess-order",
],
plugins: [
"stylelint-a11y", // https://github.com/YozhikM/stylelint-a11y
"stylelint-declaration-block-no-ignored-properties", // https://github.com/kristerkari/stylelint-declaration-block-no-ignored-properties
"stylelint-high-performance-animation", // https://github.com/kristerkari/stylelint-high-performance-animation
"stylelint-selector-no-empty", // https://github.com/ssivanatarajan/stylelint-selector-no-empty
"stylelint-selector-tag-no-without-class", // https://github.com/Moxio/stylelint-selector-tag-no-without-class
],
rules: {
// https://github.com/stylelint/stylelint/blob/master/docs/user-guide/rules.md
"at-rule-no-unknown": [true, { ignoreAtRules: ["use"] }],
"color-named": "never",
"color-no-hex": null,
"shorthand-property-no-redundant-values": true,
"value-no-vendor-prefix": true,
"color-hex-case": "lower",
"color-hex-length": "short", // https://youtu.be/Sd14d1t5vbQ?t=888
"function-name-case": "lower",
"length-zero-no-unit": true,
"unit-case": "lower",
"value-keyword-case": "lower",
"value-list-comma-space-before": "never",
"property-case": "lower",
// ...
"no-empty-source": null,
// ...
"no-eol-whitespace": true,
"no-missing-end-of-source-newline": true,
"no-empty-first-line": true,
"plugin/8-point-grid": {
base: 4,
allowlist: ["2px", "1px"],
ignorelist: [
"width",
"height",
"min-width",
"min-height",
"max-width",
"max-height",
],
},
// FIX: ignores /* styleling-disable */
//"a11y/content-property-no-static-value": [true, { "severity": "warning" }],
//"a11y/font-size-is-readable": [true, { "severity": "warning" }],
//"a11y/media-prefers-reduced-motion": true, // autofix makes code unmaintainable and unreadable
//"a11y/media-prefers-color-scheme": [true, { "severity": "warning" }], // autofix makes code unmaintainable and unreadable
"a11y/no-display-none": [true, { severity: "warning" }],
"a11y/no-obsolete-attribute": [true, { severity: "warning" }],
"a11y/no-obsolete-element": [true, { severity: "warning" }],
"a11y/no-spread-text": [true, { severity: "warning" }],
"a11y/no-outline-none": true,
"a11y/no-text-align-justify": [true, { severity: "warning" }],
"a11y/selector-pseudo-class-focus": true,
"plugin/declaration-block-no-ignored-properties": true,
/*
"scale-unlimited/declaration-strict-value": ["/color/", { // consider including font-size
ignoreVariables: true,
ignoreFunctions: false,
ignoreKeywords: {
"/color/": ["currentColor", "inherit", "transparent", "initial"]
}
}],
*/
"plugin/no-low-performance-animation-properties": [
true,
{
ignore: "paint-properties",
ignoreProperties: ["color", "background-color"],
},
],
"plugin/stylelint-selector-no-empty": true,
"plugin/selector-tag-no-without-class": ["div", "span"],
/*
"csstools/value-no-unknown-custom-properties": [true, {
"importFrom": [
"./src/styles/variables.scss"
]
}],
*/
},
};