.eslintrc.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * @Author: jixiang
  3. * @Date: 2021-07-07 15:29:47
  4. * @Description: eslintrc 配置项
  5. * @FilePath: /vite-project/.eslintrc.js
  6. * One World One Drefeel(56580223@qq.com)
  7. */
  8. module.exports = {
  9. parser: 'vue-eslint-parser',
  10. parserOptions: {
  11. parser: '@typescript-eslint/parser',
  12. ecmaVersion: 2020,
  13. sourceType: 'module',
  14. ecmaFeatures: {
  15. jsx: true,
  16. },
  17. },
  18. extends: [
  19. 'plugin:vue/vue3-recommended',
  20. 'plugin:@typescript-eslint/recommended',
  21. 'prettier/@typescript-eslint',
  22. 'plugin:prettier/recommended',
  23. ],
  24. rules: {
  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': [
  38. 'error',
  39. {
  40. argsIgnorePattern: '^h$',
  41. varsIgnorePattern: '^h$',
  42. },
  43. ],
  44. 'no-unused-vars': [
  45. 'error',
  46. {
  47. argsIgnorePattern: '^h$',
  48. varsIgnorePattern: '^h$',
  49. },
  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/html-self-closing': 'off',
  60. 'vue/require-default-prop': 'off',
  61. 'vue/html-self-closing': [
  62. 'error',
  63. {
  64. html: {
  65. void: 'always',
  66. normal: 'never',
  67. component: 'always',
  68. },
  69. svg: 'always',
  70. math: 'always',
  71. },
  72. ],
  73. },
  74. };