.eslintrc.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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: [
  22. 'plugin:vue/vue3-recommended',
  23. 'plugin:@typescript-eslint/recommended',
  24. 'prettier',
  25. 'plugin:prettier/recommended',
  26. '@unocss'
  27. ],
  28. rules: {
  29. "prettier/prettier": ["off", { "endOfLine": "auto" }],
  30. 'vue/script-setup-uses-vars': 'warn',
  31. 'vue/no-reserved-component-names': 'off',
  32. 'vue/no-setup-props-destructure': 'off',
  33. '@typescript-eslint/ban-ts-ignore': 'off',
  34. '@typescript-eslint/explicit-function-return-type': 'off',
  35. '@typescript-eslint/no-explicit-any': 'off',
  36. '@typescript-eslint/no-var-requires': 'off',
  37. '@typescript-eslint/no-empty-function': 'off',
  38. 'vue/custom-event-name-casing': 'off',
  39. 'no-use-before-define': 'off',
  40. '@typescript-eslint/no-use-before-define': 'off',
  41. '@typescript-eslint/ban-ts-comment': 'off',
  42. '@typescript-eslint/ban-types': 'off',
  43. '@typescript-eslint/no-non-null-assertion': 'off',
  44. '@typescript-eslint/explicit-module-boundary-types': 'off',
  45. '@typescript-eslint/no-unused-vars': 'off',
  46. 'no-unused-vars': 'off',
  47. 'space-before-function-paren': 'off',
  48. 'vue/attributes-order': 'off',
  49. 'vue/one-component-per-file': 'off',
  50. 'vue/html-closing-bracket-newline': 'off',
  51. 'vue/max-attributes-per-line': 'off',
  52. 'vue/multiline-html-element-content-newline': 'off',
  53. 'vue/singleline-html-element-content-newline': 'off',
  54. 'vue/attribute-hyphenation': 'off',
  55. 'vue/require-default-prop': 'off',
  56. 'vue/require-explicit-emits': 'off',
  57. "vue/first-attribute-linebreak": ["error", {
  58. "singleline": "ignore",
  59. "multiline": "ignore"
  60. }],
  61. 'vue/html-self-closing': [
  62. 'warn',
  63. {
  64. html: {
  65. void: 'always',
  66. normal: 'never',
  67. component: 'always'
  68. },
  69. svg: 'always',
  70. math: 'always'
  71. }
  72. ],
  73. 'vue/multi-word-component-names': 'off',
  74. 'vue/no-v-html': 'off'
  75. }
  76. })