.eslintrc.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. ecmaVersion: 2020,
  24. sourceType: 'module',
  25. },
  26. // "writable" 以允许重写变量,或 "readonly" 不允许重写变量
  27. globals: {
  28. XE: "readonly",
  29. VE_ENV: "readonly",
  30. VE_API: "readonly",
  31. LZ_WARNS: "readonly",
  32. defineOptions: "readonly", // 支持Vue 3编译器宏
  33. },
  34. rules: {
  35. indent: [2, 4, { SwitchCase: 1 }],
  36. // "prettier/prettier": [2, { tabWidth: 4, endOfLine: "auto" }],
  37. "prettier/prettier": "off",
  38. "no-console": "warn",
  39. "no-debugger": "warn",
  40. "no-unused-vars": "off",
  41. "no-dupe-keys":"warn",
  42. "indent": "off",
  43. "no-case-declarations":"off",
  44. "no-inner-declarations":"off",
  45. "no-loss-of-precision":"off",
  46. "vue/multi-word-component-names": 0,
  47. },
  48. };