.stylelintrc.cjs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. module.exports = {
  2. // 继承推荐规范配置
  3. extends: [
  4. "stylelint-config-standard",
  5. "stylelint-config-recommended-scss",
  6. "stylelint-config-recommended-vue/scss",
  7. "stylelint-config-html/vue",
  8. "stylelint-config-recess-order",
  9. ],
  10. // 指定不同文件对应的解析器
  11. overrides: [
  12. {
  13. files: ["**/*.{vue,html}"],
  14. customSyntax: "postcss-html",
  15. },
  16. {
  17. files: ["**/*.{css,scss}"],
  18. customSyntax: "postcss-scss",
  19. },
  20. ],
  21. // 自定义规则
  22. rules: {
  23. "import-notation": "string", // 指定导入CSS文件的方式("string"|"url")
  24. "selector-class-pattern": null, // 选择器类名命名规则
  25. "custom-property-pattern": null, // 自定义属性命名规则
  26. "keyframes-name-pattern": null,
  27. "property-no-unknown": null, // 允许未知的属性
  28. "no-descending-specificity": null,
  29. // 允许 global 、export 伪类
  30. "selector-pseudo-class-no-unknown": [
  31. true,
  32. {
  33. ignorePseudoClasses: ["global", "export", "deep"],
  34. },
  35. ],
  36. },
  37. };