build: add BEM style lint rule
This commit is contained in:
parent
09f567f509
commit
b4ed1be170
|
@ -24,6 +24,14 @@ module.exports = {
|
|||
"no-empty-source": null,
|
||||
"no-descending-specificity": null,
|
||||
"number-leading-zero": "never",
|
||||
"selector-class-pattern": [
|
||||
// Matches class name likes this: block__elem--mod or block1__elem1--mod1-block2__elem2--mod2-...
|
||||
/^(?:(weui|ant|BraftEditor)-[a-zA-Z-_]+|(?:(?:(?:^|(?!^)-)[a-z]+\d*|-[a-z]*\d+)(?:__[a-z]+\d*|__[a-z]*\d+){0,1}(?:--[a-z]+\d*|--[a-z]*\d+){0,1})*)$/u, {
|
||||
"severity": "error",
|
||||
"resolveNestedSelectors": true,
|
||||
"message": "Selector should be written in BEM style (selector-class-pattern)",
|
||||
},
|
||||
],
|
||||
"selector-id-pattern": /^\$?[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u,
|
||||
"selector-max-compound-selectors": null,
|
||||
"selector-no-qualifying-type": null,
|
||||
|
|
Loading…
Reference in New Issue