-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstylelint.js
48 lines (48 loc) · 2.01 KB
/
stylelint.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
/**
* Stylelint Configuration File
* https://stylelint.io/user-guide/configuration
*
* Plugins:
* stylelint-scss - https://github.com/kristerkari/stylelint-scss
* stylelint-prettier - https://github.com/prettier/stylelint-prettier
*
* Configurations:
* stylelint-config-recommended - https://github.com/stylelint/stylelint-config-recommended
* stylelint-config-sass-guidelines - https://github.com/bjankord/stylelint-config-sass-guidelines
* stylelint-prettier/recommended - https://github.com/prettier/stylelint-prettier#recommended-configuration
* stylelint-config-recommended-vue/scss - https://github.com/ota-meshi/stylelint-config-recommended-vue
*
*/
module.exports = {
ignoreFiles: ['**/*.js'],
plugins: ['stylelint-scss', 'stylelint-prettier'],
overrides: [
{
files: ['**/*.{vue}'],
customSyntax: 'postcss-html',
},
{
files: ['**/*.{scss}'],
customSyntax: 'postcss-scss',
},
],
extends: [
'stylelint-config-recommended',
'stylelint-config-sass-guidelines',
'stylelint-prettier/recommended',
'stylelint-config-recommended-vue/scss',
],
rules: {
'prettier/prettier': true,
// http://stylelint.io/user-guide/rules/max-nesting-depth#max-nesting-depth
'max-nesting-depth': 10,
// https://stylelint.io/user-guide/rules/selector-max-compound-selectors
'selector-max-compound-selectors': 10,
// https://github.com/kristerkari/stylelint-scss/blob/master/src/rules/at-import-no-partial-leading-underscore/README.md
'scss/at-import-no-partial-leading-underscore': null,
// https://medium.com/takeaway-tech/the-search-for-a-regex-to-match-hyphenated-bem-css-class-names-5f8b66cc2bd9
'selector-class-pattern':
// eslint-disable-next-line max-len
'^(?:(?: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]+)*)?(?:\\[.+\\])?$',
},
};