.eslintrc.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. module.exports = {
  2. extends: ['soybeanjs/vue'],
  3. overrides: [
  4. {
  5. files: ['./scripts/*.ts'],
  6. rules: {
  7. 'no-unused-expressions': 'off'
  8. }
  9. },
  10. {
  11. files: ['*.vue'],
  12. rules: {
  13. 'no-undef': 'off' // use tsc to check the ts code of the vue
  14. }
  15. }
  16. ],
  17. settings: {
  18. 'import/core-modules': ['uno.css', '~icons/*', 'virtual:svg-icons-register']
  19. },
  20. rules: {
  21. 'import/order': [
  22. 'error',
  23. {
  24. 'newlines-between': 'never',
  25. groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
  26. pathGroups: [
  27. {
  28. pattern: 'vue',
  29. group: 'external',
  30. position: 'before'
  31. },
  32. {
  33. pattern: 'vue-router',
  34. group: 'external',
  35. position: 'before'
  36. },
  37. {
  38. pattern: 'pinia',
  39. group: 'external',
  40. position: 'before'
  41. },
  42. {
  43. pattern: 'naive-ui',
  44. group: 'external',
  45. position: 'before'
  46. },
  47. {
  48. pattern: '@/constants',
  49. group: 'internal',
  50. position: 'before'
  51. },
  52. {
  53. pattern: '@/config',
  54. group: 'internal',
  55. position: 'before'
  56. },
  57. {
  58. pattern: '@/settings',
  59. group: 'internal',
  60. position: 'before'
  61. },
  62. {
  63. pattern: '@/plugins',
  64. group: 'internal',
  65. position: 'before'
  66. },
  67. {
  68. pattern: '@/layouts',
  69. group: 'internal',
  70. position: 'before'
  71. },
  72. {
  73. pattern: '@/views',
  74. group: 'internal',
  75. position: 'before'
  76. },
  77. {
  78. pattern: '@/components',
  79. group: 'internal',
  80. position: 'before'
  81. },
  82. {
  83. pattern: '@/router',
  84. group: 'internal',
  85. position: 'before'
  86. },
  87. {
  88. pattern: '@/service',
  89. group: 'internal',
  90. position: 'before'
  91. },
  92. {
  93. pattern: '@/store',
  94. group: 'internal',
  95. position: 'before'
  96. },
  97. {
  98. pattern: '@/context',
  99. group: 'internal',
  100. position: 'before'
  101. },
  102. {
  103. pattern: '@/composables',
  104. group: 'internal',
  105. position: 'before'
  106. },
  107. {
  108. pattern: '@/hooks',
  109. group: 'internal',
  110. position: 'before'
  111. },
  112. {
  113. pattern: '@/utils',
  114. group: 'internal',
  115. position: 'before'
  116. },
  117. {
  118. pattern: '@/assets',
  119. group: 'internal',
  120. position: 'before'
  121. },
  122. {
  123. pattern: '@/**',
  124. group: 'internal',
  125. position: 'before'
  126. }
  127. ],
  128. pathGroupsExcludedImportTypes: ['vue', 'vue-router', 'pinia', 'naive-ui']
  129. }
  130. ]
  131. }
  132. };