.eslintrc.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * @Author: your name
  3. * @Date: 2021-01-07 09:49:29
  4. * @LastEditTime: 2022-04-28 18:32:51
  5. * @LastEditors: Please set LastEditors
  6. * @Description: In User Settings Edit
  7. * @FilePath: \vue3-element-admin\.eslintrc.js
  8. */
  9. module.exports = {
  10. root: true,
  11. env: {
  12. es2020: true, // 添加ES2020支持
  13. node: true,
  14. "vue/setup-compiler-macros": true,
  15. },
  16. extends: [
  17. "plugin:vue/vue3-essential",
  18. "eslint:recommended",
  19. "@vue/prettier",
  20. ],
  21. parserOptions: {
  22. parser: "@babel/eslint-parser",
  23. requireConfigFile: false,
  24. ecmaVersion: 2020,
  25. sourceType: 'module',
  26. },
  27. // "writable" 以允许重写变量,或 "readonly" 不允许重写变量
  28. globals: {
  29. XE: "readonly",
  30. VE_ENV: "readonly",
  31. VE_API: "readonly",
  32. LZ_WARNS: "readonly",
  33. defineOptions: "readonly", // 支持Vue 3编译器宏
  34. },
  35. rules: {
  36. indent: [2, 4, { SwitchCase: 1 }],
  37. // "prettier/prettier": [2, { tabWidth: 4, endOfLine: "auto" }],
  38. "prettier/prettier": "off",
  39. "no-console": "warn",
  40. "no-debugger": "warn",
  41. "no-unused-vars": "off",
  42. "no-dupe-keys":"warn",
  43. "indent": "off",
  44. "no-case-declarations":"off",
  45. "no-inner-declarations":"off",
  46. "no-loss-of-precision":"off",
  47. "vue/multi-word-component-names": 0,
  48. },
  49. };