.stylelintrc.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. module.exports = {
  2. processors: [],
  3. plugins: ['stylelint-order'],
  4. extends: [
  5. 'stylelint-config-standard',
  6. 'stylelint-config-css-modules'
  7. ],
  8. rules: {
  9. 'selector-class-pattern': null,
  10. 'string-quotes': 'single', // 单引号
  11. 'at-rule-empty-line-before': null,
  12. 'at-rule-no-unknown': null,
  13. 'at-rule-name-case': 'lower', // 指定@规则名的大小写
  14. 'length-zero-no-unit': true, // 禁止零长度的单位(可自动修复)
  15. 'shorthand-property-no-redundant-values': true, // 简写属性
  16. 'number-leading-zero': 'never', // 小数不带0
  17. 'declaration-block-no-duplicate-properties': null, // 禁止声明快重复属性
  18. 'no-descending-specificity': null, // 禁止在具有较高优先级的选择器后出现被其覆盖的较低优先级的选择器。
  19. 'selector-max-id': 3, // 限制一个选择器中 ID 选择器的数量
  20. 'max-nesting-depth': 4,
  21. 'indentation': [2, { // 指定缩进 warning 提醒
  22. 'severity': 'warning'
  23. }],
  24. 'order/properties-order': [ // 规则顺序
  25. 'position',
  26. 'top',
  27. 'right',
  28. 'bottom',
  29. 'left',
  30. 'z-index',
  31. 'display',
  32. 'float',
  33. 'width',
  34. 'height',
  35. 'max-width',
  36. 'max-height',
  37. 'min-width',
  38. 'min-height',
  39. 'padding',
  40. 'padding-top',
  41. 'padding-right',
  42. 'padding-bottom',
  43. 'padding-left',
  44. 'margin',
  45. 'margin-top',
  46. 'margin-right',
  47. 'margin-bottom',
  48. 'margin-left',
  49. 'margin-collapse',
  50. 'margin-top-collapse',
  51. 'margin-right-collapse',
  52. 'margin-bottom-collapse',
  53. 'margin-left-collapse',
  54. 'overflow',
  55. 'overflow-x',
  56. 'overflow-y',
  57. 'clip',
  58. 'clear',
  59. 'font',
  60. 'font-family',
  61. 'font-size',
  62. 'font-smoothing',
  63. 'osx-font-smoothing',
  64. 'font-style',
  65. 'font-weight',
  66. 'line-height',
  67. 'letter-spacing',
  68. 'word-spacing',
  69. 'color',
  70. 'text-align',
  71. 'text-decoration',
  72. 'text-indent',
  73. 'text-overflow',
  74. 'text-rendering',
  75. 'text-size-adjust',
  76. 'text-shadow',
  77. 'text-transform',
  78. 'word-break',
  79. 'word-wrap',
  80. 'white-space',
  81. 'vertical-align',
  82. 'list-style',
  83. 'list-style-type',
  84. 'list-style-position',
  85. 'list-style-image',
  86. 'pointer-events',
  87. 'cursor',
  88. 'background',
  89. 'background-color',
  90. 'border',
  91. 'border-radius',
  92. 'content',
  93. 'outline',
  94. 'outline-offset',
  95. 'opacity',
  96. 'filter',
  97. 'visibility',
  98. 'size',
  99. 'transform'
  100. ]
  101. }
  102. }