.eslintrc.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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-parsing-error': 'off',
  58. 'vue/no-deprecated-v-on-native-modifier': 'off',
  59. 'vue/multi-word-component-names': 'off',
  60. 'no-useless-escape': 'off',
  61. 'no-sparse-arrays': 'off',
  62. 'no-prototype-builtins': 'off',
  63. 'no-constant-condition': 'off',
  64. 'no-use-before-define': 'off',
  65. 'no-restricted-globals': 'off',
  66. 'no-restricted-syntax': 'off',
  67. 'generator-star-spacing': 'off',
  68. 'no-unreachable': 'off',
  69. 'no-multiple-template-root': 'off',
  70. 'no-unused-vars': 'error',
  71. 'no-v-model-argument': 'off',
  72. 'no-case-declarations': 'off',
  73. 'no-console': 'error',
  74. 'no-redeclare': 'off',
  75. },
  76. };