.eslintrc.cjs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. module.exports = {
  2. root: true,
  3. env: {
  4. browser: true,
  5. es2021: true,
  6. node: true,
  7. 'vue/setup-compiler-macros': true,
  8. },
  9. parser: 'vue-eslint-parser',
  10. parserOptions: {
  11. ecmaVersion: 12,
  12. parser: '@typescript-eslint/parser',
  13. sourceType: 'module',
  14. },
  15. extends: ['plugin:vue/vue3-essential', 'plugin:vue/vue3-recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
  16. plugins: ['vue', '@typescript-eslint'],
  17. rules: {
  18. // http://eslint.cn/docs/rules/
  19. // https://eslint.vuejs.org/rules/
  20. '@typescript-eslint/no-empty-function': 'off',
  21. '@typescript-eslint/no-explicit-any': 'off',
  22. '@typescript-eslint/no-non-null-assertion': 'off',
  23. '@typescript-eslint/ban-types': 'off',
  24. '@typescript-eslint/ban-ts-ignore': 'off',
  25. '@typescript-eslint/no-unused-vars': [
  26. 'warn',
  27. {
  28. argsIgnorePattern: '^_',
  29. varsIgnorePattern: '^_',
  30. },
  31. ],
  32. 'no-unused-vars': [
  33. 'warn',
  34. {
  35. argsIgnorePattern: '^_',
  36. varsIgnorePattern: '^_',
  37. },
  38. ],
  39. 'vue/v-on-event-hyphenation': 'off',
  40. 'vue/custom-event-name-casing': 'off',
  41. 'vue/component-definition-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/require-default-prop': 'off',
  51. 'vue/no-arrow-functions-in-watch': 'off',
  52. 'vue/no-v-html': 'off',
  53. 'vue/comment-directive': 'off',
  54. 'vue/multi-word-component-names': 'off',
  55. 'vue/require-prop-types': 'off',
  56. 'no-useless-escape': 'off',
  57. 'no-sparse-arrays': 'off',
  58. 'no-prototype-builtins': 'off',
  59. 'no-use-before-define': 'off',
  60. 'no-case-declarations': 'off',
  61. 'no-console': 'off',
  62. 'vue/html-indent': 'off',
  63. indent: [1, 4, { SwitchCase: 1 }],
  64. },
  65. globals: {
  66. window: true,
  67. NodeJS: true,
  68. },
  69. }