eslint.config.mjs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
  2. import {
  3. configureVueProject,
  4. defineConfigWithVueTs,
  5. vueTsConfigs,
  6. } from '@vue/eslint-config-typescript'
  7. import { globalIgnores } from 'eslint/config'
  8. import simpleImportSort from 'eslint-plugin-simple-import-sort'
  9. import pluginVue from 'eslint-plugin-vue'
  10. configureVueProject({ scriptLangs: ['ts', 'tsx'] })
  11. export default defineConfigWithVueTs(
  12. {
  13. name: 'app/files-to-lint',
  14. files: ['**/*.{js,mjs,cjs,ts,mts,tsx,vue}'],
  15. },
  16. {
  17. name: 'app/linter-options',
  18. linterOptions: {
  19. reportUnusedDisableDirectives: false,
  20. },
  21. },
  22. globalIgnores([
  23. '**/dist/**',
  24. '**/dist-ssr/**',
  25. '**/coverage/**',
  26. '**/node_modules/**',
  27. '**/.rsbuild/**',
  28. '**/.rspack_cache/**',
  29. '**/.cache/**',
  30. '**/public/**',
  31. '**/.github/**',
  32. '**/.husky/**',
  33. '**/.vscode/**',
  34. '**/.idea/**',
  35. '**/code-style/**',
  36. '**/docs/**',
  37. '**/bin/**',
  38. '**/src/mock/**',
  39. '**/*.md',
  40. '**/*.woff',
  41. '**/*.ttf',
  42. '**/Dockerfile',
  43. '**/commitlint.config.js',
  44. ]),
  45. pluginVue.configs['flat/essential'],
  46. vueTsConfigs.recommended,
  47. skipFormatting,
  48. {
  49. name: 'app/rules',
  50. plugins: {
  51. 'simple-import-sort': simpleImportSort,
  52. },
  53. rules: {
  54. '@typescript-eslint/ban-ts-comment': 'off',
  55. '@typescript-eslint/no-empty-object-type': 'off',
  56. '@typescript-eslint/no-explicit-any': 'off',
  57. '@typescript-eslint/no-require-imports': 'off',
  58. '@typescript-eslint/no-this-alias': 'off',
  59. '@typescript-eslint/no-unused-expressions': 'off',
  60. '@typescript-eslint/no-unused-vars': 'off',
  61. '@typescript-eslint/no-unsafe-function-type': 'off',
  62. 'no-async-promise-executor': 'off',
  63. 'no-unused-vars': 'off',
  64. 'prefer-const': 'off',
  65. 'simple-import-sort/exports': 'warn',
  66. 'simple-import-sort/imports': [
  67. 'warn',
  68. {
  69. groups: [['^\\u0000'], ['^node:'], ['^@?\\w'], ['^@/'], ['^\\.']],
  70. },
  71. ],
  72. 'vue/attributes-order': [
  73. 'warn',
  74. {
  75. alphabetical: false,
  76. order: [
  77. 'DEFINITION',
  78. 'LIST_RENDERING',
  79. 'CONDITIONALS',
  80. 'RENDER_MODIFIERS',
  81. 'GLOBAL',
  82. ['UNIQUE', 'SLOT'],
  83. 'TWO_WAY_BINDING',
  84. 'OTHER_DIRECTIVES',
  85. 'OTHER_ATTR',
  86. 'EVENTS',
  87. 'CONTENT',
  88. ],
  89. },
  90. ],
  91. 'vue/multi-word-component-names': 'off',
  92. 'vue/no-dupe-keys': 'warn',
  93. 'vue/no-undef-properties': 'error',
  94. 'vue/no-unused-properties': 'warn',
  95. },
  96. },
  97. )