-
Notifications
You must be signed in to change notification settings - Fork 5
/
.stylelintrc.shared.js
64 lines (62 loc) · 2.02 KB
/
.stylelintrc.shared.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
/* eslint "sort-keys": "error" -- more readability keys */
const ENV = require('./app.env');
module.exports = {
'extends': [],
'plugins': [],
'rules': {
// code quality rules (fastest)
'declaration-block-no-duplicate-custom-properties': null,
'declaration-block-no-duplicate-properties': [
true,
{
'ignore': ['consecutive-duplicates-with-different-values'],
},
],
'declaration-property-unit-allowed-list': [
{
'font-size': ['rem', 'vw', 'vh', 'vmin', 'vmax'], // only rem, vw, vh unit
'letter-spacing': ['em'], // only em unit
'line-height': [], // only unit less
},
{
'ignore': ['inside-function'],
},
],
'declaration-property-value-disallowed-list': {
'display': ['grid', 'inline-grid'], // https://caniuse.com/?search=grid
},
'no-duplicate-selectors': [
true,
{
'disallowInList': false,
},
],
'property-disallowed-list': [
[
// https://caniuse.com/?search=gap
'gap',
'row-gap',
'column-gap',
// https://caniuse.com/?search=aspect-ratio
'aspect-ratio',
],
],
...(ENV.PROD
? // code style rules (slowest)
{
'color-hex-alpha': 'never',
'property-no-unknown': [
true,
{
'ignoreProperties': ['content-visibility'],
},
],
}
: // dev-only rules (better dev experience)
{
'declaration-block-no-duplicate-custom-properties': null,
'declaration-block-no-duplicate-properties': null,
'no-duplicate-selectors': null,
}),
},
};