stylelint.config.mjs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /** @type {import('stylelint').Config} */
  2. export default {
  3. extends: ['stylelint-config-standard', 'stylelint-config-property-sort-order-smacss'],
  4. plugins: ['stylelint-order', 'stylelint-prettier'],
  5. // customSyntax: 'postcss-html',
  6. overrides: [
  7. {
  8. files: ['**/*.(css|html|vue)'],
  9. customSyntax: 'postcss-html',
  10. },
  11. {
  12. files: ['*.less', '**/*.less'],
  13. customSyntax: 'postcss-less',
  14. extends: ['stylelint-config-standard', 'stylelint-config-recommended-vue'],
  15. },
  16. {
  17. files: ['*.scss', '**/*.scss'],
  18. customSyntax: 'postcss-scss',
  19. extends: ['stylelint-config-standard-scss', 'stylelint-config-recommended-vue/scss'],
  20. rule: {
  21. 'scss/percent-placeholder-pattern': null,
  22. },
  23. },
  24. ],
  25. rules: {
  26. 'prettier/prettier': true,
  27. 'media-feature-range-notation': null,
  28. 'selector-not-notation': null,
  29. 'import-notation': null,
  30. 'function-no-unknown': null,
  31. 'selector-class-pattern': null,
  32. 'selector-pseudo-class-no-unknown': [
  33. true,
  34. {
  35. ignorePseudoClasses: ['global', 'deep'],
  36. },
  37. ],
  38. 'selector-pseudo-element-no-unknown': [
  39. true,
  40. {
  41. ignorePseudoElements: ['v-deep'],
  42. },
  43. ],
  44. 'at-rule-no-unknown': [
  45. true,
  46. {
  47. ignoreAtRules: [
  48. 'tailwind',
  49. 'apply',
  50. 'variants',
  51. 'responsive',
  52. 'screen',
  53. 'function',
  54. 'if',
  55. 'each',
  56. 'include',
  57. 'mixin',
  58. 'extend',
  59. ],
  60. },
  61. ],
  62. 'no-empty-source': null,
  63. 'named-grid-areas-no-invalid': null,
  64. 'no-descending-specificity': null,
  65. 'font-family-no-missing-generic-family-keyword': null,
  66. 'rule-empty-line-before': [
  67. 'always',
  68. {
  69. ignore: ['after-comment', 'first-nested'],
  70. },
  71. ],
  72. 'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }],
  73. 'order/order': [
  74. [
  75. 'dollar-variables',
  76. 'custom-properties',
  77. 'at-rules',
  78. 'declarations',
  79. {
  80. type: 'at-rule',
  81. name: 'supports',
  82. },
  83. {
  84. type: 'at-rule',
  85. name: 'media',
  86. },
  87. 'rules',
  88. ],
  89. { severity: 'error' },
  90. ],
  91. },
  92. ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'],
  93. };