.eslintrc.js 757 B

12345678910111213141516171819202122232425262728
  1. module.exports = {
  2. root: true,
  3. env: {
  4. node: true,
  5. 'vue/setup-compiler-macros': true, // 支持Vue3的编译宏
  6. },
  7. extends: ['plugin:vue/vue3-essential', 'eslint:recommended', '@vue/prettier'],
  8. parserOptions: {
  9. parser: '@babel/eslint-parser', // 解析 Vue 中的 ES6+ 语法
  10. ecmaVersion: 'latest',
  11. sourceType: 'module'
  12. },
  13. rules: {
  14. 'no-unused-vars': 'off',
  15. "prettier/prettier": "off",
  16. 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  17. 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  18. 'vue/multi-word-component-names': 'off',
  19. },
  20. plugins: [
  21. 'vue' // 启用 Vue 插件
  22. ],
  23. settings: {
  24. 'vue': {
  25. 'version': '3.0' // 指定 Vue 版本
  26. }
  27. }
  28. }