stylelint.config.js 2.3 KB

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