stylelint.config.cjs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. module.exports = {
  2. root: true,
  3. plugins: ['stylelint-order'],
  4. customSyntax: 'postcss-html',
  5. extends: ['stylelint-config-standard'],
  6. rules: {
  7. 'selector-pseudo-class-no-unknown': [
  8. true,
  9. {
  10. ignorePseudoClasses: ['global', 'deep']
  11. }
  12. ],
  13. 'at-rule-no-unknown': [
  14. true,
  15. {
  16. ignoreAtRules: ['function', 'if', 'each', 'include', 'mixin']
  17. }
  18. ],
  19. 'media-query-no-invalid': null,
  20. 'function-no-unknown': null,
  21. 'no-empty-source': null,
  22. 'named-grid-areas-no-invalid': null,
  23. 'no-descending-specificity': null,
  24. 'font-family-no-missing-generic-family-keyword': null,
  25. 'rule-empty-line-before': [
  26. 'always',
  27. {
  28. ignore: ['after-comment', 'first-nested']
  29. }
  30. ],
  31. 'unit-no-unknown': [
  32. true,
  33. {
  34. ignoreUnits: ['rpx']
  35. }
  36. ],
  37. 'order/order': [
  38. [
  39. 'dollar-variables',
  40. 'custom-properties',
  41. 'at-rules',
  42. 'declarations',
  43. {
  44. type: 'at-rule',
  45. name: 'supports'
  46. },
  47. {
  48. type: 'at-rule',
  49. name: 'media'
  50. },
  51. 'rules'
  52. ],
  53. {
  54. severity: 'warning'
  55. }
  56. ],
  57. // Specify the alphabetical order of the attributes in the declaration block
  58. 'order/properties-order': [
  59. 'position',
  60. 'top',
  61. 'right',
  62. 'bottom',
  63. 'left',
  64. 'z-index',
  65. 'display',
  66. 'float',
  67. 'width',
  68. 'height',
  69. 'max-width',
  70. 'max-height',
  71. 'min-width',
  72. 'min-height',
  73. 'padding',
  74. 'padding-top',
  75. 'padding-right',
  76. 'padding-bottom',
  77. 'padding-left',
  78. 'margin',
  79. 'margin-top',
  80. 'margin-right',
  81. 'margin-bottom',
  82. 'margin-left',
  83. 'margin-collapse',
  84. 'margin-top-collapse',
  85. 'margin-right-collapse',
  86. 'margin-bottom-collapse',
  87. 'margin-left-collapse',
  88. 'overflow',
  89. 'overflow-x',
  90. 'overflow-y',
  91. 'clip',
  92. 'clear',
  93. 'font',
  94. 'font-family',
  95. 'font-size',
  96. 'font-smoothing',
  97. 'osx-font-smoothing',
  98. 'font-style',
  99. 'font-weight',
  100. 'hyphens',
  101. 'src',
  102. 'line-height',
  103. 'letter-spacing',
  104. 'word-spacing',
  105. 'color',
  106. 'text-align',
  107. 'text-decoration',
  108. 'text-indent',
  109. 'text-overflow',
  110. 'text-rendering',
  111. 'text-size-adjust',
  112. 'text-shadow',
  113. 'text-transform',
  114. 'word-break',
  115. 'word-wrap',
  116. 'white-space',
  117. 'vertical-align',
  118. 'list-style',
  119. 'list-style-type',
  120. 'list-style-position',
  121. 'list-style-image',
  122. 'pointer-events',
  123. 'cursor',
  124. 'background',
  125. 'background-attachment',
  126. 'background-color',
  127. 'background-image',
  128. 'background-position',
  129. 'background-repeat',
  130. 'background-size',
  131. 'border',
  132. 'border-collapse',
  133. 'border-top',
  134. 'border-right',
  135. 'border-bottom',
  136. 'border-left',
  137. 'border-color',
  138. 'border-image',
  139. 'border-top-color',
  140. 'border-right-color',
  141. 'border-bottom-color',
  142. 'border-left-color',
  143. 'border-spacing',
  144. 'border-style',
  145. 'border-top-style',
  146. 'border-right-style',
  147. 'border-bottom-style',
  148. 'border-left-style',
  149. 'border-width',
  150. 'border-top-width',
  151. 'border-right-width',
  152. 'border-bottom-width',
  153. 'border-left-width',
  154. 'border-radius',
  155. 'border-top-right-radius',
  156. 'border-bottom-right-radius',
  157. 'border-bottom-left-radius',
  158. 'border-top-left-radius',
  159. 'border-radius-topright',
  160. 'border-radius-bottomright',
  161. 'border-radius-bottomleft',
  162. 'border-radius-topleft',
  163. 'content',
  164. 'quotes',
  165. 'outline',
  166. 'outline-offset',
  167. 'opacity',
  168. 'filter',
  169. 'visibility',
  170. 'size',
  171. 'zoom',
  172. 'transform',
  173. 'box-align',
  174. 'box-flex',
  175. 'box-orient',
  176. 'box-pack',
  177. 'box-shadow',
  178. 'box-sizing',
  179. 'table-layout',
  180. 'animation',
  181. 'animation-delay',
  182. 'animation-duration',
  183. 'animation-iteration-count',
  184. 'animation-name',
  185. 'animation-play-state',
  186. 'animation-timing-function',
  187. 'animation-fill-mode',
  188. 'transition',
  189. 'transition-delay',
  190. 'transition-duration',
  191. 'transition-property',
  192. 'transition-timing-function',
  193. 'background-clip',
  194. 'backface-visibility',
  195. 'resize',
  196. 'appearance',
  197. 'user-select',
  198. 'interpolation-mode',
  199. 'direction',
  200. 'marks',
  201. 'page',
  202. 'set-link-source',
  203. 'unicode-bidi',
  204. 'speak'
  205. ]
  206. },
  207. ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'],
  208. overrides: [
  209. {
  210. files: ['*.vue', '**/*.vue', '*.html', '**/*.html'],
  211. extends: ['stylelint-config-recommended', 'stylelint-config-html'],
  212. rules: {
  213. 'keyframes-name-pattern': null,
  214. 'selector-class-pattern': null,
  215. 'no-duplicate-selectors': null,
  216. 'selector-pseudo-class-no-unknown': [
  217. true,
  218. {
  219. ignorePseudoClasses: ['deep', 'global']
  220. }
  221. ],
  222. 'selector-pseudo-element-no-unknown': [
  223. true,
  224. {
  225. ignorePseudoElements: ['v-deep', 'v-global', 'v-slotted']
  226. }
  227. ]
  228. }
  229. }
  230. ]
  231. }