Commit fa6442ee authored by Nikolay Gromov's avatar Nikolay Gromov

Stylelint: добавил проверку БЭМ и соответствия имени файла и Блока

parent d85ff257
{
"syntax": "scss",
# http://stylelint.io/user-guide/rules/
"plugins": [
"stylelint-selector-bem-pattern"
],
"rules": {
# https://github.com/postcss/postcss-bem-linter#custom-patterns
"plugin/selector-bem-pattern": [{
"implicitComponents": true,
"componentName": "[-a-z]+",
"componentSelectors": {
"initial": "^(\\.{componentName}(__[a-z]+|--[-a-z0-9]+|__[-a-z]+--[-a-z0-9]+|.[-a-z]+|__[a-z]+.[-a-z]+)?)$",
"combined": "^.+$"
},
"ignoreSelectors": [
"^\\.(no-)?js(-modal-open)?$",
"a(\\[[a-z]+|:[a-z]+)?",
"h[1-6]",
"pre",
"blockquote",
"thead",
"tr",
"img",
"img",
"p",
"table",
"^&:empty",
"#{\\$[-a-z]+}__[-a-z]+",
"^\\*$"
],
},
{
"severity": "warning",
"message": "Селектор не из имени файла или БЭМ-ошибка"
}],
# http://stylelint.io/user-guide/rules/
"color-hex-case": ["lower", {
"severity": "warning",
"message": "HEX цвета буквами строчными указывать следует"
......
......@@ -77,6 +77,7 @@
/** @define choices */
.choices {
$block-name: &; // #{$block-name}__element
......
......@@ -326,3 +326,4 @@ pre {
background: transparent;
}
}
......@@ -100,4 +100,3 @@
}
}
}
......@@ -8,7 +8,7 @@
line-height: 1.2em;
color: $text-color--muted;
&:empty {
&:empty { // stylelint-disable-line
display: none;
}
}
......
......@@ -123,7 +123,7 @@ $grid-gutter-width: 30px !default;
display: flex;
flex-wrap: wrap;
& > * { // stylelint-disable-line selector-combinator-blacklist
& > * { // stylelint-disable-line selector-combinator-blacklist, plugin/selector-bem-pattern
flex-basis: 100%;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment