generated from germanfrelo/template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstylelint.config.js
57 lines (55 loc) · 1.81 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
/** @type {import('stylelint').Config} */
export default {
extends: [
"stylelint-config-html/astro", // Provides Astro support
// The order of configs is important: later configs take precedence over earlier ones
"stylelint-config-standard", // Extends stylelint-config-recommended and turns on additional rules to enforce modern conventions
"stylelint-config-recess-order", // Sorts CSS properties
],
plugins: ["stylelint-plugin-defensive-css"], // Enforces defensive CSS best practices
reportDescriptionlessDisables: true,
reportInvalidScopeDisables: true,
reportNeedlessDisables: true,
reportUnscopedDisables: true,
rules: {
/* Avoid errors
---------------------------------------- */
// Descending
"no-descending-specificity": [
true, // Already enabled in stylelint-config-recommended
{ severity: "warning" }, // Default is 'error', but I prefer 'warning'
],
// Unknown
"no-unknown-animations": true,
"no-unknown-custom-media": true,
"no-unknown-custom-properties": true,
/* Enforce conventions
(overrides rules from stylelint-config-standard)
---------------------------------------- */
// Empty lines
"declaration-empty-line-before": "never",
// Pattern
"custom-media-pattern": null,
"custom-property-pattern": null,
"keyframes-name-pattern": null,
"selector-class-pattern": null,
"selector-id-pattern": null,
// Redundant
"declaration-block-no-redundant-longhand-properties": null,
/* Plugin: use-defensive-css
---------------------------------------- */
"plugin/use-defensive-css": [
true,
{
"severity": "warning",
"accidental-hover": false,
"background-repeat": true,
"custom-property-fallbacks": true,
"flex-wrapping": true,
"scroll-chaining": true,
"scrollbar-gutter": false,
"vendor-prefix-grouping": true,
},
],
},
};