.eslintrc.cjs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. module.exports = {
  2. env: {
  3. browser: true,
  4. node: true,
  5. es6: true
  6. },
  7. parser: 'vue-eslint-parser',
  8. extends: [
  9. 'plugin:vue/vue3-recommended',
  10. './.eslintrc-auto-import.json',
  11. 'plugin:@typescript-eslint/recommended',
  12. 'prettier',
  13. 'plugin:prettier/recommended'
  14. ],
  15. parserOptions: {
  16. ecmaVersion: '2020',
  17. sourceType: 'module',
  18. project: './tsconfig.*?.json',
  19. parser: '@typescript-eslint/parser'
  20. },
  21. plugins: ['vue', '@typescript-eslint', 'import', 'promise', 'node', 'prettier'],
  22. rules: {
  23. '@typescript-eslint/no-empty-function': 'off',
  24. '@typescript-eslint/no-explicit-any': 'off',
  25. '@typescript-eslint/no-unused-vars': 'off',
  26. '@typescript-eslint/no-this-alias': 'off',
  27. // vue
  28. 'vue/multi-word-component-names': 'off',
  29. 'vue/valid-define-props': 'off',
  30. 'vue/no-v-model-argument': 'off',
  31. 'prefer-rest-params': 'off',
  32. // prettier
  33. 'prettier/prettier': 'error',
  34. '@typescript-eslint/ban-types': [
  35. 'error',
  36. {
  37. // 关闭空类型检查 {}
  38. extendDefaults: true,
  39. types: {
  40. '{}': false,
  41. Function: false
  42. }
  43. }
  44. ]
  45. },
  46. globals: {
  47. DialogOption: 'readonly',
  48. OptionType: 'readonly'
  49. }
  50. };