stylelint.config.js 2.1 KB

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