stylelint.config.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. module.exports = {
  2. defaultSeverity: 'warning',
  3. extends: ['stylelint-config-standard-scss', 'stylelint-config-recess-order', 'stylelint-config-recommended-vue'],
  4. plugins: ['stylelint-declaration-block-no-ignored-properties'],
  5. rules: {
  6. 'scss/no-global-function-names': null,
  7. 'plugin/declaration-block-no-ignored-properties': true,
  8. 'order/properties-alphabetical-order': null,
  9. 'no-descending-specificity': null,
  10. // 样式块中不允许重复的属性
  11. 'declaration-block-no-duplicate-properties': true,
  12. // 指定颜色函数使用传统符号隔开
  13. 'color-function-notation': 'legacy',
  14. // 函数 url 链接不允许 shceme relative
  15. 'function-url-no-scheme-relative': true,
  16. // 可组合成一个属性的写法,不允许拆开书写
  17. 'declaration-block-no-redundant-longhand-properties': true,
  18. // 选择器最大深度
  19. 'selector-max-compound-selectors': 8,
  20. // 限制 id选择器的数目在一个选择器中
  21. 'selector-max-id': 1,
  22. // 最多2个类型选择器
  23. 'selector-max-type': 2,
  24. // 不允许未知的动画
  25. 'no-unknown-animations': true,
  26. // 在字体名称必须使用引号的地方使用引号,其他地方不能使用
  27. 'font-family-name-quotes': 'always-unless-keyword',
  28. // url 函数内部必须有引号
  29. 'function-url-quotes': 'always',
  30. // 为类选择器指定一个模式
  31. 'selector-class-pattern': null,
  32. 'at-rule-no-unknown': [true, { ignoreAtRules: ['import', 'include', 'mixin', 'include', 'extend', 'each'] }],
  33. 'max-nesting-depth': [8, { ignore: ['blockless-at-rules', 'pseudo-classes'] }],
  34. 'selector-no-qualifying-type': [true, { ignore: ['attribute', 'class', 'id'] }],
  35. 'value-keyword-case': ['lower', { camelCaseSvgKeywords: true }],
  36. 'value-no-vendor-prefix': [true, { ignoreValues: ['box'] }],
  37. 'selector-pseudo-class-no-unknown': [true, { ignorePseudoClasses: ['deep'] }]
  38. // 'declaration-property-value-no-unknown': [true, { ignoreProperties: { '/.+/': '/^v-bind(.*)$/' } }]
  39. }
  40. };