forked from GoogleChrome/developer.chrome.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.stylelintrc.js
More file actions
24 lines (21 loc) · 778 Bytes
/
.stylelintrc.js
File metadata and controls
24 lines (21 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Tell stylelint to lint using BEM syntax
// This is some next level regex right here 😅
// https://github.com/bjankord/stylelint-config-sass-guidelines/issues/20
const BEM_PATTERN = '^(?:(?:o|c|u|t|s|is|has|_|js|qa)-)?[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*(?:__[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:--[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:\\[.+\\])?$';
module.exports = {
extends: 'stylelint-config-sass-guidelines',
rules: {
// Allow a max nesting depth of 2
'max-nesting-depth': 2,
'selector-class-pattern': BEM_PATTERN,
'scss/percent-placeholder-pattern': BEM_PATTERN,
// Allow selectors like input[type=button]
// but not input.foo or input#foo
'selector-no-qualifying-type': [
true,
{
ignore: ["attribute"],
}
]
}
};