.eslintrc.cjs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. '*': 'off',
  24. '@typescript-eslint/no-empty-function': 'off',
  25. '@typescript-eslint/no-explicit-any': 'off',
  26. '@typescript-eslint/no-unused-vars': 'off',
  27. '@typescript-eslint/no-this-alias': 'off',
  28. // vue
  29. 'vue/multi-word-component-names': 'off',
  30. 'vue/valid-define-props': 'off',
  31. 'vue/no-v-model-argument': 'off',
  32. 'prefer-rest-params': 'off',
  33. // prettier
  34. 'prettier/prettier': 'error',
  35. '@typescript-eslint/ban-types': [
  36. 'error',
  37. {
  38. // 关闭空类型检查 {}
  39. extendDefaults: true,
  40. types: {
  41. '{}': false,
  42. Function: false
  43. }
  44. }
  45. ]
  46. },
  47. globals: {
  48. DialogOption: 'readonly',
  49. OptionType: 'readonly'
  50. }
  51. };