-
Notifications
You must be signed in to change notification settings - Fork 0
/
scss.js
51 lines (46 loc) · 2.05 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
module.exports = {
extends: 'stylelint-config-standard-scss',
rules: {
/* eslint-disable sort-keys -- We need to set CSS rules before SCSS rules. */
// Restore `comment-no-empty` of `stylelint-config-standard-scss` as per `stylelint-config-recommended`.
// https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/comment-no-empty/README.md
'comment-no-empty': true,
// 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-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 _)',
},
],
/* eslint-enable sort-keys */
},
};