stylelint.config.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. module.exports = {
  2. root: true,
  3. plugins: ['stylelint-order'],
  4. customSyntax: 'postcss-less',
  5. extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
  6. rules: {
  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. 'named-grid-areas-no-invalid': null,
  39. 'unicode-bom': 'never',
  40. 'no-descending-specificity': null,
  41. 'font-family-no-missing-generic-family-keyword': null,
  42. 'declaration-colon-space-after': 'always-single-line',
  43. 'declaration-colon-space-before': 'never',
  44. // 'declaration-block-trailing-semicolon': 'always',
  45. 'rule-empty-line-before': [
  46. 'always',
  47. {
  48. ignore: ['after-comment', 'first-nested'],
  49. },
  50. ],
  51. 'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }],
  52. 'order/order': [
  53. [
  54. 'dollar-variables',
  55. 'custom-properties',
  56. 'at-rules',
  57. 'declarations',
  58. {
  59. type: 'at-rule',
  60. name: 'supports',
  61. },
  62. {
  63. type: 'at-rule',
  64. name: 'media',
  65. },
  66. 'rules',
  67. ],
  68. { severity: 'warning' },
  69. ],
  70. },
  71. ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'],
  72. overrides: [
  73. {
  74. files: ['*.vue', '**/*.vue'],
  75. extends: ['stylelint-config-recommended', 'stylelint-config-html'],
  76. rules: {
  77. 'selector-pseudo-class-no-unknown': [
  78. true,
  79. {
  80. ignorePseudoClasses: ['deep', 'global'],
  81. },
  82. ],
  83. 'selector-pseudo-element-no-unknown': [
  84. true,
  85. {
  86. ignorePseudoElements: ['v-deep', 'v-global', 'v-slotted'],
  87. },
  88. ],
  89. },
  90. },
  91. ],
  92. };