.eslintrc.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. module.exports = {
  2. root: true,
  3. globals: {
  4. defineProps: 'readonly',
  5. defineEmits: 'readonly',
  6. },
  7. parserOptions: {
  8. parser: '@typescript-eslint/parser',
  9. ecmaVersion: 'latest',
  10. sourceType: 'module',
  11. ecmaFeatures: {
  12. jsx: true,
  13. },
  14. },
  15. env: {
  16. browser: true,
  17. node: true,
  18. es6: true,
  19. },
  20. // https://eslint.vuejs.org/
  21. extends: [
  22. 'plugin:@typescript-eslint/recommended',
  23. 'plugin:vue/base',
  24. 'plugin:vue/vue3-essential',
  25. 'plugin:vue/vue3-strongly-recommended',
  26. 'plugin:vue/vue3-recommended',
  27. 'prettier',
  28. ],
  29. // add your custom rules here
  30. rules: {
  31. // override/add rules settings here, such as:
  32. // 'vue/no-unused-vars': 'error'
  33. eqeqeq: ['error', 'always', { null: 'ignore' }],
  34. 'no-var': 2,
  35. 'no-console': 0,
  36. 'no-debugger': 0,
  37. 'no-new-wrappers': 2, // 禁止new String() 等等
  38. 'no-duplicate-imports': 1, // 禁止重复imports
  39. 'no-multiple-empty-lines': [
  40. 1,
  41. {
  42. max: 2,
  43. },
  44. ],
  45. 'no-eval': 2,
  46. semi: 1,
  47. <<<<<<< HEAD
  48. <<<<<<< HEAD
  49. indent: off,
  50. =======
  51. =======
  52. >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
  53. indent: [
  54. 2,
  55. 4,
  56. {
  57. SwitchCase: 1,
  58. },
  59. ],
  60. <<<<<<< HEAD
  61. >>>>>>> e94f5f44564039f665611f42b365b51740d0649c
  62. =======
  63. >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
  64. camelcase: 2,
  65. 'vue/no-empty-component-block': 2, // 禁止<template> <script> <style>块为空
  66. 'vue/html-self-closing': 0,
  67. 'vue/max-attributes-per-line': 0,
  68. 'vue/singleline-html-element-content-newline': 0,
  69. 'vue/attribute-hyphenation': 0,
  70. 'vue/multi-word-component-names': 0,
  71. 'vue/html-indent': 0,
  72. 'vue/v-on-event-hyphenation': [2, 'never'],
  73. // Enable vue/script-setup-uses-vars rule
  74. "eqeqeq": 0
  75. },
  76. };