使用stylelint效验css语法

添加styl lint

参考 官方:https://stylelint.io/user-guide/configure
#### 添加styl
```json
    "stylelint": "^13.6.1",
    "stylelint-config-prettier": "^8.0.2",
    "stylelint-config-rational-order": "^0.1.2",
    "stylelint-config-standard": "^20.0.0",
    "stylelint-declaration-block-no-ignored-properties": "^2.3.0",
    "stylelint-order": "^4.1.0",

package.json script

"lint:style": "stylelint 'src/**/*.less' --syntax less",

.stylelintrc.json

{
  "extends": [
    "stylelint-config-standard",
    "stylelint-config-rational-order",
    "stylelint-config-prettier"
  ],
  "plugins": ["stylelint-order", "stylelint-declaration-block-no-ignored-properties"],
  "rules": {
    "comment-empty-line-before": null,
    "function-name-case": ["lower", { "ignoreFunctions": ["/colorPalette/"] }],
    "no-invalid-double-slash-comments": null,
    "no-descending-specificity": null,
    "declaration-empty-line-before": null
  },
  "ignoreFiles": ["components/style/color/{bezierEasing,colorPalette,tinyColor}.less"]
}

如果想要把某个规则去掉,我们需要在 rules 里面添加这个规则,并且设置为 null

这个是错误产生的效果

使用stylelint效验css语法-王树东

下面图片是 ,被忽略的错误

使用stylelint效验css语法-王树东