stylelint.config.mjs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. export default {
  2. extends: ['stylelint-config-standard', 'stylelint-config-recess-order'],
  3. ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts', '**/*.json', '**/*.md'],
  4. overrides: [
  5. {
  6. customSyntax: 'postcss-html',
  7. files: ['*.(html|vue)', '**/*.(html|vue)'],
  8. rules: {
  9. 'selector-pseudo-class-no-unknown': [
  10. true,
  11. {
  12. ignorePseudoClasses: ['global', 'deep'],
  13. },
  14. ],
  15. 'selector-pseudo-element-no-unknown': [
  16. true,
  17. {
  18. ignorePseudoElements: ['v-deep', 'v-global', 'v-slotted'],
  19. },
  20. ],
  21. 'selector-type-no-unknown': [
  22. true,
  23. {
  24. ignoreTypes: ['page', 'uni-page-body', 'uni-toast'],
  25. },
  26. ],
  27. },
  28. },
  29. {
  30. customSyntax: 'postcss-scss',
  31. extends: ['stylelint-config-recommended-scss', 'stylelint-config-recommended-vue/scss'],
  32. files: ['*.scss', '**/*.scss'],
  33. rules: {
  34. 'scss/at-rule-no-unknown': [
  35. true,
  36. {
  37. ignoreAtRules: [
  38. 'extends',
  39. 'ignores',
  40. 'include',
  41. 'mixin',
  42. 'if',
  43. 'else',
  44. 'media',
  45. 'for',
  46. 'at-root',
  47. 'tailwind',
  48. 'apply',
  49. 'page',
  50. 'variants',
  51. 'responsive',
  52. 'screen',
  53. 'function',
  54. 'each',
  55. 'use',
  56. 'forward',
  57. 'return',
  58. ],
  59. },
  60. ],
  61. 'selector-type-no-unknown': [
  62. true,
  63. {
  64. ignoreTypes: ['page'],
  65. },
  66. ],
  67. },
  68. },
  69. ],
  70. plugins: [
  71. 'stylelint-order',
  72. '@stylistic/stylelint-plugin',
  73. 'stylelint-prettier',
  74. 'stylelint-scss',
  75. ],
  76. rules: {
  77. 'at-rule-no-unknown': [
  78. true,
  79. {
  80. ignoreAtRules: [
  81. 'extends',
  82. 'ignores',
  83. 'include',
  84. 'mixin',
  85. 'if',
  86. 'else',
  87. 'media',
  88. 'for',
  89. 'at-root',
  90. 'tailwind',
  91. 'apply',
  92. 'variants',
  93. 'responsive',
  94. 'screen',
  95. 'function',
  96. 'each',
  97. 'use',
  98. 'forward',
  99. 'return',
  100. ],
  101. },
  102. ],
  103. 'font-family-no-missing-generic-family-keyword': null,
  104. 'function-no-unknown': null,
  105. 'import-notation': null,
  106. 'media-feature-range-notation': null,
  107. 'named-grid-areas-no-invalid': null,
  108. 'no-descending-specificity': null,
  109. 'no-empty-source': null,
  110. 'order/order': [
  111. [
  112. 'dollar-variables',
  113. 'custom-properties',
  114. 'at-rules',
  115. 'declarations',
  116. {
  117. name: 'supports',
  118. type: 'at-rule',
  119. },
  120. {
  121. name: 'media',
  122. type: 'at-rule',
  123. },
  124. {
  125. name: 'include',
  126. type: 'at-rule',
  127. },
  128. 'rules',
  129. ],
  130. { severity: 'error' },
  131. ],
  132. 'prettier/prettier': true,
  133. 'rule-empty-line-before': [
  134. 'always',
  135. {
  136. ignore: ['after-comment', 'first-nested'],
  137. },
  138. ],
  139. 'scss/at-rule-no-unknown': [
  140. true,
  141. {
  142. ignoreAtRules: [
  143. 'extends',
  144. 'ignores',
  145. 'include',
  146. 'mixin',
  147. 'if',
  148. 'else',
  149. 'media',
  150. 'for',
  151. 'at-root',
  152. 'tailwind',
  153. 'apply',
  154. 'variants',
  155. 'responsive',
  156. 'screen',
  157. 'function',
  158. 'each',
  159. 'use',
  160. 'forward',
  161. 'return',
  162. ],
  163. },
  164. ],
  165. 'scss/operator-no-newline-after': null,
  166. 'selector-class-pattern':
  167. '^(?:(?:o|c|u|t|s|is|has|_|js|qa)-)?[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*(?:__[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:--[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:[.+])?$',
  168. 'selector-not-notation': null,
  169. 'declaration-property-value-no-unknown': [
  170. true,
  171. { ignoreProperties: { '/.+/': '/(v-bind(.*))|($.*)/' } },
  172. ],
  173. 'unit-no-unknown': [
  174. true,
  175. {
  176. ignoreUnits: ['rpx'],
  177. },
  178. ],
  179. 'value-keyword-case': null,
  180. },
  181. }