.stylelintrc.cjs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. module.exports = {
  2. 'extends': [
  3. 'stylelint-config-standard',
  4. 'stylelint-config-standard-scss',
  5. 'stylelint-config-recommended-vue',
  6. 'stylelint-config-recommended-vue/scss'
  7. ],
  8. 'plugins': ['@stylistic/stylelint-plugin'],
  9. 'ignoreFiles': ['**/*.js', '**/*.ts'],
  10. 'defaultSeverity': 'error',
  11. 'rules': {
  12. 'unit-disallowed-list': [
  13. 'rem',
  14. 'pt'
  15. ],
  16. '@stylistic/indentation': [
  17. 2,
  18. {
  19. 'baseIndentLevel': 0
  20. }
  21. ],
  22. 'no-empty-source': null,
  23. 'block-no-empty': null,
  24. 'declaration-block-no-duplicate-custom-properties': null,
  25. 'font-family-no-missing-generic-family-keyword': null,
  26. 'selector-class-pattern': '^[a-z]([a-z0-9-]+)?(__([a-z0-9]+-?)+)?(__([a-z0-9]+-?)+)?(--([a-z0-9]+-?)+){0,2}$|^Mui.*$|^([a-z][a-z0-9]*)(_[a-z0-9]+)*$',
  27. 'scss/at-mixin-pattern': '^[a-z]([a-z0-9-]+)?(__([a-z0-9]+-?)+)?(__([a-z0-9]+-?)+)?(--([a-z0-9]+-?)+){0,2}$|^Mui.*$|^([a-z][a-z0-9]*)(_[a-z0-9]+)*$',
  28. 'scss/double-slash-comment-whitespace-inside': 'always',
  29. 'scss/dollar-variable-pattern': null,
  30. 'selector-type-no-unknown': null,
  31. 'selector-pseudo-class-no-unknown': [
  32. true,
  33. {
  34. 'ignorePseudoClasses': [
  35. 'export',
  36. 'deep'
  37. ]
  38. }
  39. ],
  40. 'color-function-notation': ['modern', {
  41. 'ignore': ['with-var-inside']
  42. }],
  43. 'property-no-unknown': null,
  44. 'at-rule-empty-line-before': [
  45. 'always',
  46. {
  47. 'except': ['first-nested', 'blockless-after-same-name-blockless']
  48. }
  49. ],
  50. 'custom-property-empty-line-before': [
  51. 'always',
  52. {
  53. 'except': ['after-custom-property', 'first-nested']
  54. }
  55. ],
  56. 'declaration-empty-line-before': [
  57. 'always',
  58. {
  59. 'except': ['after-declaration', 'first-nested']
  60. }
  61. ],
  62. 'rule-empty-line-before': ['always-multi-line'],
  63. // 忽视 -webkit-xxxx 等兼容写法
  64. 'property-no-vendor-prefix': [
  65. true,
  66. {
  67. ignoreProperties: ['box-shadow']
  68. }
  69. ]
  70. }
  71. }