-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH Update stylelint rules #26
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
module.exports = { | ||
'defaultSeverity': 'warning', | ||
'extends': [ | ||
'stylelint-config-recommended-scss', | ||
'stylelint-config-sass-guidelines', | ||
|
@@ -8,6 +7,8 @@ module.exports = { | |
'plugins': [ | ||
'stylelint-scss' | ||
], | ||
// Ignore anything that isn't one of these file types | ||
'ignoreFiles': ['**/!(*.{css,scss,sass})'], | ||
'rules': { | ||
// Line Spacing | ||
'rule-empty-line-before': [ | ||
|
@@ -31,7 +32,7 @@ module.exports = { | |
} | ||
], | ||
'selector-max-id': 2, | ||
'selector-max-compound-selectors': 5, | ||
'selector-max-compound-selectors': 6, | ||
'selector-pseudo-element-colon-notation': 'single', | ||
'no-descending-specificity': [ | ||
true, | ||
|
@@ -42,7 +43,7 @@ module.exports = { | |
} | ||
], | ||
'max-nesting-depth': [ | ||
3, | ||
4, | ||
Comment on lines
45
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bumped slightly to resolve a lot of issues and avoid having to add a ignore comments for all of them. |
||
{ | ||
'ignore': [ | ||
'blockless-at-rules', | ||
|
@@ -73,7 +74,31 @@ module.exports = { | |
] | ||
} | ||
], | ||
|
||
'at-rule-no-unknown': [ | ||
true, | ||
{ | ||
// Allow sass at-rules - see https://sass-lang.com/documentation/at-rules/ | ||
'ignoreAtRules': [ | ||
'at-root', | ||
'debug', | ||
'each', | ||
'else', | ||
'error', | ||
'extend', | ||
'for', | ||
'forward', | ||
'function', | ||
'if', | ||
'import', | ||
'include', | ||
'mixin', | ||
'return', | ||
'use', | ||
'warn', | ||
'while', | ||
] | ||
} | ||
], | ||
'comment-no-empty': true, | ||
'declaration-block-no-duplicate-properties': true, | ||
'no-irregular-whitespace': true, | ||
|
@@ -86,14 +111,21 @@ module.exports = { | |
} | ||
], | ||
'font-family-name-quotes': 'always-unless-keyword', | ||
// Turn off rules | ||
// Turn off rules | ||
'selector-class-pattern': null, | ||
'selector-id-pattern': null, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't change what the IDs look like at this point, it's too likely to cause problems. |
||
'function-no-unknown': null, | ||
'property-no-vendor-prefix': null, | ||
'value-no-vendor-prefix': null, | ||
'font-family-no-missing-generic-family-keyword': null, | ||
'scss/dollar-variable-colon-space-after': null, | ||
'scss/no-global-function-names': null, | ||
'value-keyword-case': null | ||
'value-keyword-case': null, | ||
'media-query-no-invalid': null, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per https://stylelint.io/user-guide/rules/media-query-no-invalid/ this rule isn't appropriate for scss |
||
'selector-id-pattern': null, | ||
'keyframes-name-pattern': null, | ||
'scss/dollar-variable-pattern': null, | ||
Comment on lines
+125
to
+127
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A mixture of "changing these could cause problems" and "changing these isn't worth the effort, it doesn't really matter if they match some arbitrary pattern or not" |
||
'scss/at-extend-no-missing-placeholder': null, | ||
'no-descending-specificity': null, | ||
Comment on lines
+128
to
+129
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bumped slightly to resolve a lot of issues and avoid having to add a ignore comments for all of them.
This rule can't be retrospectively respected without changing the specificity of selectors, which might affect styling in adverse ways.