-
Notifications
You must be signed in to change notification settings - Fork 0
/
scss.js
66 lines (59 loc) · 2.47 KB
/
scss.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
module.exports = {
extends: [
'stylelint-config-standard-scss',
'stylelint-stylistic/config',
],
rules: {
// Disable ESlint as we intentionally break alphabetical order rule here.
/* eslint-disable sort-keys */
// Turn `comment-no-empty` back on for empty CSS comments since `scss/comment-no-empty` is turned off later on:
// https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/comment-no-empty/README.md
'comment-no-empty': true,
'selector-class-pattern': null, // Disable `stylelint-config-standard-scss`'s `selector-class-pattern` rule.
// Restrict nesting:
'selector-nested-pattern': [
'^&:',
{
message: 'Only pseudo-classes and pseudo-elements can be nested (selector-nested-pattern)',
},
],
// Override `stylelint-config-standard-scss`:
'scss/at-function-pattern': [ // Prefer _ over - for private functions.
'^(_?[a-z][a-z0-9]*)(-[a-z0-9]+)*$',
{
message: 'Expected function name to be kebab-case (private functions must start with _)',
},
],
'scss/at-mixin-argumentless-call-parentheses': 'always', // So it's always written the same way.
'scss/at-mixin-pattern': [ // Prefer _ over - for private mixins.
'^(_?[a-z][a-z0-9]*)(-[a-z0-9]+)*$',
{
message: 'Expected mixin name to be kebab-case (private mixins must start with _)',
},
],
'scss/comment-no-empty': null, // Allow empty lines in structured block comments.
'scss/dollar-variable-colon-space-after': 'always-single-line', // Support multi-line variable definitions.
'scss/dollar-variable-empty-line-before': null, // Turn off to support grouping variables using empty lines.
'scss/dollar-variable-pattern': [ // Prefer _ over - for private variables.
'^(_?[a-z][a-z0-9]*)(-[a-z0-9]+)*$',
{
message: 'Expected variable to be kebab-case (private variables must start with _)',
},
],
'scss/operator-no-newline-before': null, // Allow operator on new line because multiline expressions are better comprehensible that way.
'scss/percent-placeholder-pattern': [ // Prefer _ over - for private placeholders.
'^(_?[a-z][a-z0-9]*)(-[a-z0-9]+)*$',
{
message: 'Expected placeholder to be kebab-case (private placeholders must start with _)',
},
],
'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 */
},
};