-
Notifications
You must be signed in to change notification settings - Fork 109
/
Copy path.stylelintrc.js
87 lines (80 loc) · 2.59 KB
/
.stylelintrc.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
module.exports = {
extends: 'stylelint-config-gds/scss',
ignoreFiles: [
'**/dist/**',
'**/vendor/**',
// Ignore CSS-in-JS (including dotfiles)
'**/?(.)*.{cjs,js,mjs}'
],
overrides: [
{
customSyntax: 'postcss-markdown',
files: ['**/*.md']
},
{
customSyntax: 'postcss-markdown',
files: ['**/coding-standards.md', '**/README.md'],
rules: {
// Allow markdown `*.md` CSS bad examples
'block-no-empty': null,
'color-no-hex': null,
'selector-max-id': null,
'selector-no-qualifying-type': null,
// Allow markdown `*.md` Sass bad examples
'scss/dollar-variable-pattern': null
}
},
{
customSyntax: 'postcss-scss',
files: ['**/*.scss'],
rules: {
// Disallow hex colours
// https://stylelint.io/user-guide/rules/color-no-hex/
'color-no-hex': true,
// Properties and values that are disallowed
// https://stylelint.io/user-guide/rules/declaration-property-value-disallowed-list/
'declaration-property-value-disallowed-list': {
transition: ['all'],
'/^border/': ['none']
},
// Disallow @mixin before @extends
// https://github.com/hudochenkov/stylelint-order/blob/master/rules/order/README.md#extended-at-rule-objects
'order/order': [
{
type: 'at-rule',
name: 'extend'
},
{
type: 'at-rule',
name: 'mixin'
}
],
// Allow underscores (but not numbers) in mixin naming pattern
// https://github.com/stylelint-scss/stylelint-scss/tree/master/src/rules/at-mixin-pattern
'scss/at-mixin-pattern': [
/^([a-z-_])*$/,
{
message: 'Mixin names may only contain [a-z-_] characters'
}
],
// Allow underscores in $variable naming pattern
// https://github.com/stylelint-scss/stylelint-scss/tree/master/src/rules/dollar-variable-pattern
'scss/dollar-variable-pattern': [
/^([a-z0-9-_])*$/,
{
message: 'Variable names may only contain [a-z0-9-_] characters'
}
],
// Allow underscores (but not numbers) in %placeholder naming pattern
// https://github.com/stylelint-scss/stylelint-scss/tree/master/src/rules/percent-placeholder-pattern
'scss/percent-placeholder-pattern': [
/^([a-z-_])*$/,
{
message: 'Placeholders may only contain [a-z-_] characters'
}
]
}
}
],
plugins: ['stylelint-order']
}