.eslintrc.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. module.exports = {
  2. root: true,
  3. env: {
  4. browser: true,
  5. es2021: true,
  6. node: true,
  7. },
  8. parser: 'vue-eslint-parser',
  9. parserOptions: {
  10. ecmaVersion: 12,
  11. parser: '@typescript-eslint/parser',
  12. sourceType: 'module',
  13. },
  14. extends: ['plugin:vue/vue3-essential', 'plugin:vue/essential', 'eslint:recommended'],
  15. plugins: ['vue', '@typescript-eslint'],
  16. overrides: [
  17. {
  18. files: ['*.ts', '*.tsx', '*.vue'],
  19. rules: {
  20. 'no-undef': 'off',
  21. },
  22. },
  23. ],
  24. rules: {
  25. // http://eslint.cn/docs/rules/
  26. // https://eslint.vuejs.org/rules/
  27. // https://typescript-eslint.io/rules/no-unused-vars/
  28. '@typescript-eslint/ban-ts-ignore': 'off',
  29. '@typescript-eslint/explicit-function-return-type': 'off',
  30. '@typescript-eslint/no-explicit-any': 'off',
  31. '@typescript-eslint/no-var-requires': 'off',
  32. '@typescript-eslint/no-empty-function': 'off',
  33. '@typescript-eslint/no-use-before-define': 'off',
  34. '@typescript-eslint/ban-ts-comment': 'off',
  35. '@typescript-eslint/ban-types': 'off',
  36. '@typescript-eslint/no-non-null-assertion': 'off',
  37. '@typescript-eslint/explicit-module-boundary-types': 'off',
  38. '@typescript-eslint/no-redeclare': 'error',
  39. '@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
  40. '@typescript-eslint/no-unused-vars': [2],
  41. 'vue/custom-event-name-casing': 'off',
  42. 'vue/attributes-order': 'off',
  43. 'vue/one-component-per-file': 'off',
  44. 'vue/html-closing-bracket-newline': 'off',
  45. 'vue/max-attributes-per-line': 'off',
  46. 'vue/multiline-html-element-content-newline': 'off',
  47. 'vue/singleline-html-element-content-newline': 'off',
  48. 'vue/attribute-hyphenation': 'off',
  49. 'vue/html-self-closing': 'off',
  50. 'vue/no-multiple-template-root': 'off',
  51. 'vue/require-default-prop': 'off',
  52. 'vue/no-v-model-argument': 'off',
  53. 'vue/no-arrow-functions-in-watch': 'off',
  54. 'vue/no-template-key': 'off',
  55. 'vue/no-v-html': 'off',
  56. 'vue/comment-directive': 'off',
  57. 'vue/no-mutating-props': 'off',
  58. 'vue/no-parsing-error': 'off',
  59. 'vue/no-deprecated-v-on-native-modifier': 'off',
  60. 'vue/multi-word-component-names': 'off',
  61. 'no-useless-escape': 'off',
  62. 'no-sparse-arrays': 'off',
  63. 'no-prototype-builtins': 'off',
  64. 'no-constant-condition': 'off',
  65. 'no-use-before-define': 'off',
  66. 'no-restricted-globals': 'off',
  67. 'no-restricted-syntax': 'off',
  68. 'generator-star-spacing': 'off',
  69. 'no-unreachable': 'off',
  70. 'no-multiple-template-root': 'off',
  71. 'no-unused-vars': 'error',
  72. 'no-v-model-argument': 'off',
  73. 'no-case-declarations': 'off',
  74. 'no-console': 'error',
  75. 'no-redeclare': 'off',
  76. 'no-mixed-spaces-and-tabs': 'off',
  77. },
  78. };