.eslintrc.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. parserOptions: {
  12. parser: '@typescript-eslint/parser',
  13. ecmaVersion: 2020,
  14. sourceType: 'module',
  15. jsxPragma: 'React',
  16. ecmaFeatures: {
  17. jsx: true,
  18. },
  19. },
  20. extends: [
  21. 'plugin:vue/vue3-recommended',
  22. 'plugin:@typescript-eslint/recommended',
  23. 'prettier',
  24. 'plugin:prettier/recommended',
  25. ],
  26. rules: {
  27. 'vue/script-setup-uses-vars': 'error',
  28. 'vue/multi-word-component-names': 'off',
  29. '@typescript-eslint/ban-ts-ignore': 'off',
  30. '@typescript-eslint/explicit-function-return-type': 'off',
  31. '@typescript-eslint/no-explicit-any': 'off',
  32. '@typescript-eslint/no-var-requires': 'off',
  33. '@typescript-eslint/no-empty-function': 'off',
  34. 'vue/custom-event-name-casing': 'off',
  35. 'no-use-before-define': 'off',
  36. '@typescript-eslint/no-use-before-define': 'off',
  37. '@typescript-eslint/ban-ts-comment': 'off',
  38. '@typescript-eslint/ban-types': 'off',
  39. '@typescript-eslint/no-non-null-assertion': 'off',
  40. '@typescript-eslint/explicit-module-boundary-types': 'off',
  41. '@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '.*', args: 'none' }],
  42. 'no-unused-vars': [
  43. 'error',
  44. // we are only using this rule to check for unused arguments since TS
  45. // catches unused variables but not args.
  46. { varsIgnorePattern: '.*', args: 'none' },
  47. ],
  48. 'space-before-function-paren': 'off',
  49. 'vue/attributes-order': 'off',
  50. 'vue/one-component-per-file': 'off',
  51. 'vue/html-closing-bracket-newline': 'off',
  52. 'vue/max-attributes-per-line': 'off',
  53. 'vue/multiline-html-element-content-newline': 'off',
  54. 'vue/singleline-html-element-content-newline': 'off',
  55. 'vue/attribute-hyphenation': 'off',
  56. 'vue/require-default-prop': 'off',
  57. 'vue/html-self-closing': [
  58. 'error',
  59. {
  60. html: {
  61. void: 'always',
  62. normal: 'never',
  63. component: 'always',
  64. },
  65. svg: 'always',
  66. math: 'always',
  67. },
  68. ],
  69. },
  70. });