-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
49 lines (45 loc) · 1.68 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
module.exports = {
extends: [
'stylelint-config-standard',
'stylelint-stylistic/config',
],
rules: {
// Disable ESlint as we intentionally break alphabetical order rule here.
/* eslint-disable sort-keys */
// Extend with more strict rules:
'declaration-no-important': true, // Except for utility classes and third-party overrides, !important can be avoided.
'declaration-property-value-disallowed-list': [
{
'/^background/': [ // Background images should be stored locally.
'http:',
'https:',
],
'/^transition/': [ // Only hardware-accelerable properties should be transitioned.
'/all/',
],
},
{
message: 'Transitioning all properties and absolute background URLs are '
+ 'not allowed (declaration-property-value-disallowed-list)',
},
],
'max-nesting-depth': [ // Because too complex nesting is hard to read.
2, {
ignore: ['blockless-at-rules'],
},
],
'selector-max-compound-selectors': 3, // Keep selector specificity as low as possible by default.
'selector-max-id': 0, // In most cases, IDs are for JavaScript, not CSS.
'selector-max-specificity': '0,4,0', // Keep selector specificity as low as possible by default.
'selector-max-universal': 0, // Most of the time, we should know what elements or classes we are targeting.
'selector-no-qualifying-type': true, // In most cases, it only needlessly increases selector specificity.
'stylistic/indentation': 'tab', // Use tabs for indentation.
'stylistic/string-quotes': 'single', // Use single quotes for strings.
'stylistic/block-closing-brace-newline-after': [
'always', {
ignoreAtRules: ['if', 'else'],
},
],
/* eslint-enable sort-keys */
},
};