eslint.config.mjs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. import js from '@eslint/js';
  2. import vue from 'eslint-plugin-vue';
  3. import tseslint from '@typescript-eslint/eslint-plugin';
  4. import vueParser from 'vue-eslint-parser';
  5. import globals from 'globals';
  6. export default [
  7. {
  8. ignores: [
  9. '**/*.sh',
  10. '**/node_modules',
  11. '**/lib',
  12. '**/*.md',
  13. '**/*.scss',
  14. '**/*.woff',
  15. '**/*.ttf',
  16. '**/.vscode',
  17. '**/.idea',
  18. '**/dist',
  19. '**/mock',
  20. '**/public',
  21. '**/bin',
  22. '**/build',
  23. '**/config',
  24. '**/index.html',
  25. 'src/assets',
  26. ],
  27. },
  28. js.configs.recommended,
  29. {
  30. plugins: {
  31. vue,
  32. '@typescript-eslint': tseslint,
  33. },
  34. languageOptions: {
  35. parser: vueParser,
  36. parserOptions: {
  37. parser: '@typescript-eslint/parser',
  38. ecmaVersion: 2022,
  39. sourceType: 'module',
  40. },
  41. globals: {
  42. ...globals.browser,
  43. ...globals.node,
  44. },
  45. },
  46. rules: {
  47. '@typescript-eslint/ban-ts-ignore': 'off',
  48. '@typescript-eslint/explicit-function-return-type': 'off',
  49. '@typescript-eslint/no-explicit-any': 'off',
  50. '@typescript-eslint/no-var-requires': 'off',
  51. '@typescript-eslint/no-empty-function': 'off',
  52. '@typescript-eslint/no-use-before-define': 'off',
  53. '@typescript-eslint/ban-ts-comment': 'off',
  54. '@typescript-eslint/ban-types': 'off',
  55. '@typescript-eslint/no-non-null-assertion': 'off',
  56. '@typescript-eslint/explicit-module-boundary-types': 'off',
  57. '@typescript-eslint/no-redeclare': 'off',
  58. '@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
  59. '@typescript-eslint/no-unused-vars': 'warn',
  60. 'vue/no-unused-vars': 'off',
  61. 'vue/no-mutating-props': 'warn',
  62. 'vue/custom-event-name-casing': 'off',
  63. 'vue/attributes-order': 'off',
  64. 'vue/one-component-per-file': 'off',
  65. 'vue/html-closing-bracket-newline': 'off',
  66. 'vue/max-attributes-per-line': 'off',
  67. 'vue/multiline-html-element-content-newline': 'off',
  68. 'vue/singleline-html-element-content-newline': 'off',
  69. 'vue/attribute-hyphenation': 'off',
  70. 'vue/valid-v-else': 'warn',
  71. 'vue/no-deprecated-filter': 'warn',
  72. 'vue/html-self-closing': 'off',
  73. 'vue/no-multiple-template-root': 'off',
  74. 'vue/require-default-prop': 'off',
  75. 'vue/no-v-model-argument': 'off',
  76. 'vue/no-arrow-functions-in-watch': 'off',
  77. 'vue/no-template-key': 'off',
  78. 'vue/no-v-for-template-key': 'warn',
  79. 'vue/no-v-html': 'off',
  80. 'vue/comment-directive': 'off',
  81. 'vue/no-parsing-error': 'off',
  82. 'vue/no-deprecated-v-on-native-modifier': 'off',
  83. 'vue/multi-word-component-names': 'off',
  84. 'no-constant-binary-expression': 'warn',
  85. 'no-useless-escape': 'off',
  86. 'no-sparse-arrays': 'off',
  87. 'no-prototype-builtins': 'off',
  88. 'no-constant-condition': 'off',
  89. 'no-use-before-define': 'off',
  90. 'no-restricted-globals': 'off',
  91. 'no-restricted-syntax': 'off',
  92. 'generator-star-spacing': 'off',
  93. 'no-unreachable': 'off',
  94. 'no-multiple-template-root': 'off',
  95. 'no-unused-vars': 'off',
  96. 'no-v-model-argument': 'off',
  97. 'no-case-declarations': 'off',
  98. 'no-console': 'off',
  99. 'no-redeclare': 'off',
  100. },
  101. },
  102. {
  103. files: ['**/*.ts', '**/*.tsx', '**/*.vue'],
  104. rules: {
  105. 'no-undef': 'off',
  106. },
  107. },
  108. ];