.eslintrc.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * @Author: mzr
  3. * @Date: 2023-04-07 14:59:16
  4. * @LastEditors: wzh
  5. * @LastEditTime: 2023-09-18 16:43:47
  6. * @Description:
  7. */
  8. module.exports = {
  9. root: true,
  10. parser: 'vue-eslint-parser',
  11. parserOptions: {
  12. // 指定ESlint的解析器
  13. parser: '@typescript-eslint/parser',
  14. // 允许使用ES语法
  15. ecmaVersion: 2020,
  16. // 允许使用import
  17. sourceType: 'module',
  18. // 允许解析JSX
  19. ecmaFeatures: {
  20. jsx: true,
  21. },
  22. },
  23. env: {
  24. browser: true,
  25. },
  26. extends: [
  27. 'plugin:vue/essential',
  28. '@vue/standard',
  29. 'plugin:@typescript-eslint/recommended',
  30. // '@vue/prettier',
  31. // '@vue/prettier/@typescript-eslint'
  32. ],
  33. plugins: [
  34. // 'vue'
  35. '@typescript-eslint/eslint-plugin'
  36. ],
  37. rules: {
  38. // allow debugger during development
  39. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  40. 'vue/no-parsing-error': [2, {
  41. "x-invalid-end-tag": false
  42. }],
  43. '@typescript-eslint/no-explicit-any': 'off',
  44. '@typescript-eslint/ban-ts-comment': 'off',
  45. '@typescript-eslint/no-unused-vars': 0,
  46. '@typescript-eslint/no-empty-function': 0,
  47. '@typescript-eslint/no-this-alias': 0,
  48. 'vue/no-mutating-props': 'off',
  49. 'vue/script-setup-uses-vars': 'off'
  50. }
  51. }