我正在尝试使用stylelint和stylelint-selector-bem-pattern
插件对 BEM 样式进行 lint,但无法使其正常工作。
我的配置如下:
- 节点:5.11.0
- gulp-stylelint:^2.0.2
- stylelint-selector-bem 模式:^0.2.3
.stylelintrc
{
"plugins": [
"stylelint-selector-bem-pattern"
],
"rules": {
"selector-bem-pattern": {
preset: "suit"
},
},
"extends": "@alienlebarge/stylelint-config",
}
和一个用于测试的 CSS 文件
.12ad2-asd--sad {
color: rgba(255, 0, 0, .5);
}
#yeah {
height: 10px;
}
@alienlebarge/stylelint-config
我从插件而不是从插件中收到错误消息stylelint-selector-bem-pattern
src/assets/foehn/styles/foehn.css
4:1 ✖ Unexpected empty line max-empty-lines
5:1 ✖ Unexpected empty line max-empty-lines
6:1 ✖ Unexpected empty line max-empty-lines
7:1 ✖ Unexpected empty line max-empty-lines
8:1 ✖ Unexpected empty line max-empty-lines
9:1 ✖ Unexpected empty line max-empty-lines
9:1 ✖ Unexpected id selector selector-no-id