标签:regular eric int 其他 ping vue sele tree 设置
1.安装依赖
npm install --save-dev stylelint stylelint-scss stylelint-config-standard stylelint-csstree-validator stylelint-config-prettier
2.安装插件stylelint
3.在项目根目录添加文件 .stylelintrc.json,并添加以下内容
{
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
"rules": {}
}
4.设置不需要检测的文件,在项目根目录添加文件.stylelintignore,并添加以下内容
# .stylelintignore
# 旧的不需打包的样式库
*.min.css
# 其他类型文件
*.js
*.jpg
*.woff
# 测试和打包目录
/test/
/dist/
# 忽略的目录
*element-variables.css
5.可能遇到的报错
a.Unexpected unknown at-rule "@mixin" (at-rule-no-unknown)
添加rules规则
"rules": {
"at-rule-no-unknown":[true,{
"ignoreAtRules":["mixin"]
}]
}
b.Unexpected missing generic font family (font-family-no-missing-generic-family-keyword)
font-family后面添加sans-serif例如:
font-family: PingFangSC-Regular, PingFang SC, sans-serif;
c....no-descending-specificity
// 禁止低优先级的选择器出现在高优先级的选择器之后
"no-descending-specificity": null
d.Unexpected unknown pseudo-element selector "::v-deep" (selector-pseudo-element-no-unknown)
"selector-pseudo-element-no-unknown":null
标签:regular eric int 其他 ping vue sele tree 设置
原文地址:https://www.cnblogs.com/jack123/p/14704743.html