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