stylelint.config.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. // 指定2个空格
  11. indentation: 2,
  12. // 样式块中不允许重复的属性
  13. 'declaration-block-no-duplicate-properties': true,
  14. // 指定颜色函数使用传统符号隔开
  15. 'color-function-notation': 'legacy',
  16. // 函数 url 链接不允许 shceme relative
  17. 'function-url-no-scheme-relative': true,
  18. // 可组合成一个属性的写法,不允许拆开书写
  19. 'declaration-block-no-redundant-longhand-properties': true,
  20. // 选择器最大深度
  21. 'selector-max-compound-selectors': 10,
  22. // 限制 id选择器的数目在一个选择器中
  23. 'selector-max-id': 1,
  24. // 最多2个类型选择器
  25. 'selector-max-type': 2,
  26. // 不允许未知的动画
  27. 'no-unknown-animations': true,
  28. // 在字体名称必须使用引号的地方使用引号,其他地方不能使用
  29. 'font-family-name-quotes': 'always-unless-keyword',
  30. // url 函数内部必须有引号
  31. 'function-url-quotes': 'always',
  32. // 指定字符串引号为单引号
  33. 'string-quotes': 'single',
  34. // 为类选择器指定一个模式
  35. 'selector-class-pattern': null,
  36. 'at-rule-no-unknown': [true, { ignoreAtRules: ['import', 'include', 'mixin', 'include', 'extend'] }],
  37. 'max-nesting-depth': [10, { ignore: ['blockless-at-rules', 'pseudo-classes'] }],
  38. 'selector-no-qualifying-type': [true, { ignore: ['attribute', 'class', 'id'] }],
  39. 'value-keyword-case': ['lower', { camelCaseSvgKeywords: true }],
  40. 'value-no-vendor-prefix': [true, { ignoreValues: ['box'] }],
  41. 'selector-pseudo-class-no-unknown': [true, { ignorePseudoClasses: ['deep'] }],
  42. 'declaration-property-value-no-unknown': true
  43. }
  44. };