.eslintrc.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // @ts-check
  2. const { defineConfig } = require('eslint-define-config')
  3. module.exports = defineConfig({
  4. root: true,
  5. env: {
  6. browser: true,
  7. node: true,
  8. es6: true
  9. },
  10. parser: 'vue-eslint-parser',
  11. plugins: ['vue'],
  12. parserOptions: {
  13. parser: '@typescript-eslint/parser',
  14. ecmaVersion: 2020,
  15. sourceType: 'module',
  16. jsxPragma: 'React',
  17. ecmaFeatures: {
  18. jsx: true
  19. }
  20. },
  21. extends: ['plugin:vue/vue3-recommended', 'prettier', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
  22. rules: {
  23. 'vue/script-setup-uses-vars': 'error',
  24. 'vue/no-reserved-component-names': 'off',
  25. '@typescript-eslint/ban-ts-ignore': 'off',
  26. '@typescript-eslint/explicit-function-return-type': 'off',
  27. '@typescript-eslint/no-explicit-any': 'off',
  28. '@typescript-eslint/no-var-requires': 'off',
  29. '@typescript-eslint/no-empty-function': 'off',
  30. 'vue/custom-event-name-casing': 'off',
  31. 'no-use-before-define': 'off',
  32. '@typescript-eslint/no-use-before-define': 'off',
  33. '@typescript-eslint/ban-ts-comment': 'off',
  34. '@typescript-eslint/ban-types': 'off',
  35. '@typescript-eslint/no-non-null-assertion': 'off',
  36. '@typescript-eslint/explicit-module-boundary-types': 'off',
  37. '@typescript-eslint/no-unused-vars': 'error',
  38. 'no-unused-vars': 'error',
  39. 'space-before-function-paren': 'off',
  40. 'vue/attributes-order': 'off',
  41. 'vue/one-component-per-file': 'off',
  42. 'vue/html-closing-bracket-newline': 'off',
  43. 'vue/max-attributes-per-line': 'off',
  44. 'vue/multiline-html-element-content-newline': 'off',
  45. 'vue/singleline-html-element-content-newline': 'off',
  46. 'vue/attribute-hyphenation': 'off',
  47. 'vue/require-default-prop': 'off',
  48. 'vue/require-explicit-emits': 'off',
  49. 'vue/html-self-closing': [
  50. 'error',
  51. {
  52. html: {
  53. void: 'always',
  54. normal: 'never',
  55. component: 'always'
  56. },
  57. svg: 'always',
  58. math: 'always'
  59. }
  60. ],
  61. 'vue/multi-word-component-names': 'off'
  62. }
  63. })