Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
fix(Linting): Add Stylelint to enforce semantic selector usage
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ketch committed Jan 30, 2020
1 parent 8c5862c commit a6a4b89
Show file tree
Hide file tree
Showing 3 changed files with 3,146 additions and 150 deletions.
30 changes: 30 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-selector-pattern",
"stylelint-declaration-block-no-ignored-properties",
"stylelint-declaration-strict-value",
"stylelint-selector-tag-no-without-class"
],
"rules": {
"selector-pseudo-class-case": null,
"no-descending-specificity": null,
"plugin/declaration-block-no-ignored-properties": true,
"plugin/selector-tag-no-without-class": "tag",
"scale-unlimited/declaration-strict-value": [
["/color/", "font-size", "fill", "stroke"], {
ignoreKeywords: ["currentColor", "inherit"],
}],
"xi/selector-pattern": [
"^(?:(?:{element}{pseudo}?)*{combinator}?(?:{element}{pseudo}?)?)+$",
{
"subpatterns": {
"semantic": ":--[A-z][A-z0-9]+",
"element": "(?:\\w*:--[A-z][A-z0-9]+|:root)",
"pseudo": "(?::{1,2}(?:\\w|-)+)",
"combinator": "(:?\\s*(?:>|\\+|~|\\s+|\\|\\|)\\s*)"
}
}
],
}
}
Loading

0 comments on commit a6a4b89

Please sign in to comment.