stylelint.config.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. module.exports = {
  2. root: true,
  3. plugins: ['stylelint-order'],
  4. customSyntax: 'postcss-html',
  5. extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
  6. rules: {
  7. 'function-no-unknown': null,
  8. 'selector-class-pattern': null,
  9. 'selector-pseudo-class-no-unknown': [
  10. true,
  11. {
  12. ignorePseudoClasses: ['global'],
  13. },
  14. ],
  15. 'selector-pseudo-element-no-unknown': [
  16. true,
  17. {
  18. ignorePseudoElements: ['v-deep'],
  19. },
  20. ],
  21. 'at-rule-no-unknown': [
  22. true,
  23. {
  24. ignoreAtRules: [
  25. 'tailwind',
  26. 'apply',
  27. 'variants',
  28. 'responsive',
  29. 'screen',
  30. 'function',
  31. 'if',
  32. 'each',
  33. 'include',
  34. 'mixin',
  35. ],
  36. },
  37. ],
  38. 'no-empty-source': null,
  39. 'string-quotes': null,
  40. 'named-grid-areas-no-invalid': null,
  41. 'unicode-bom': 'never',
  42. 'no-descending-specificity': null,
  43. 'font-family-no-missing-generic-family-keyword': null,
  44. 'declaration-colon-space-after': 'always-single-line',
  45. 'declaration-colon-space-before': 'never',
  46. // 'declaration-block-trailing-semicolon': 'always',
  47. 'rule-empty-line-before': [
  48. 'always',
  49. {
  50. ignore: ['after-comment', 'first-nested'],
  51. },
  52. ],
  53. 'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }],
  54. 'order/order': [
  55. [
  56. 'dollar-variables',
  57. 'custom-properties',
  58. 'at-rules',
  59. 'declarations',
  60. {
  61. type: 'at-rule',
  62. name: 'supports',
  63. },
  64. {
  65. type: 'at-rule',
  66. name: 'media',
  67. },
  68. 'rules',
  69. ],
  70. { severity: 'warning' },
  71. ],
  72. },
  73. ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'],
  74. overrides: [
  75. {
  76. files: ['*.vue', '**/*.vue', '*.html', '**/*.html'],
  77. extends: ['stylelint-config-recommended', 'stylelint-config-html'],
  78. rules: {
  79. 'keyframes-name-pattern': null,
  80. 'selector-pseudo-class-no-unknown': [
  81. true,
  82. {
  83. ignorePseudoClasses: ['deep', 'global'],
  84. },
  85. ],
  86. 'selector-pseudo-element-no-unknown': [
  87. true,
  88. {
  89. ignorePseudoElements: ['v-deep', 'v-global', 'v-slotted'],
  90. },
  91. ],
  92. },
  93. },
  94. {
  95. files: ['*.less', '**/*.less'],
  96. customSyntax: 'postcss-less',
  97. extends: ['stylelint-config-standard', 'stylelint-config-recommended-vue'],
  98. },
  99. ],
  100. };