forked from wagtail/stylelint-config-wagtail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
89 lines (89 loc) · 2.88 KB
/
index.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
module.exports = {
extends: [
'stylelint-config-recommended-scss',
'stylelint-config-prettier-scss',
],
plugins: ['stylelint-declaration-strict-value'],
rules: {
'block-no-empty': true,
'color-hex-length': 'short',
'color-named': 'never',
'comment-no-empty': true,
'declaration-block-no-duplicate-properties': true,
'declaration-block-no-redundant-longhand-properties': true,
'declaration-block-single-line-max-declarations': 1,
'declaration-property-value-allowed-list': {
// Only allow logical values, and resets.
'clear': ['both', 'none'],
// Only allow logical values, and resets.
'float': ['inline-start', 'inline-end', 'none', 'unset'],
// Only allow logical values.
'text-align': ['start', 'end', 'center'],
},
'declaration-property-value-disallowed-list': [
{ '/^border/': ['none'] },
{ severity: 'error' },
],
'declaration-no-important': true,
'font-family-no-duplicate-names': true,
'function-calc-no-unspaced-operator': true,
'function-linear-gradient-no-nonstandard-direction': true,
'function-url-quotes': 'always',
'length-zero-no-unit': true,
'max-nesting-depth': 3,
'media-feature-name-no-unknown': true,
'no-empty-source': true,
'property-disallowed-list': [
// Disallow positioning with physical properties. Use logical ones instead.
'/left/',
'/right/',
],
'property-no-unknown': true,
'property-no-vendor-prefix': true,
'rule-empty-line-before': [
'always',
{ except: ['after-single-line-comment', 'first-nested'] },
],
'scale-unlimited/declaration-strict-value': [
[
// Colors should always be defined from variables or functions.
'/color/',
'fill',
'stroke',
// Font tokens should come from our design tokens.
'font-family',
'font-size',
'font-weight',
// Spacing should use a consistent scale rather than hard-coded values.
'/margin/',
'/padding/',
'gap',
// Consistently using variables for z-index allows us to define the order of the values globally.
'z-index',
],
{
ignoreValues: [
'currentColor',
'inherit',
'initial',
'none',
'transparent',
],
},
],
'scss/at-import-partial-extension': null,
'scss/at-import-partial-extension-blacklist': ['scss'],
'scss/media-feature-value-dollar-variable': [
'always',
{ ignore: ['keywords'] },
],
'scss/selector-no-redundant-nesting-selector': true,
'selector-max-id': 0,
'selector-no-qualifying-type': [true, { ignore: ['attribute', 'class'] }],
'selector-pseudo-element-no-unknown': true,
'selector-type-no-unknown': true,
'string-no-newline': true,
'unit-no-unknown': true,
'value-no-vendor-prefix': true,
},
};