stylelint.config.js 2.4 KB

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