.eslintrc.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * @Author: PoJun
  3. * @Date: 2023-08-09 16:38:18
  4. * @LastEditors: PoJun
  5. * @LastEditTime: 2023-08-15 13:47:39
  6. * @Message: Nothing
  7. */
  8. module.exports = {
  9. root: true,
  10. env: {
  11. node: true,
  12. },
  13. extends: ["plugin:vue/essential", "eslint:recommended"],
  14. parserOptions: {
  15. parser: "babel-eslint",
  16. },
  17. rules: {
  18. "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
  19. "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
  20. "no-alert": 0, //禁止使用alert confirm prompt
  21. "no-empty": 2, //块语句中的内容不能为空
  22. "no-nested-ternary": 0, //禁止使用嵌套的三目运算
  23. "no-redeclare": 2, //禁止重复声明变量
  24. "no-spaced-func": 2, //函数调用时 函数名与()之间不能有空格
  25. "no-unreachable": 2, //不能有无法执行的代码
  26. "no-unused-vars": [2, { vars: "all", args: "after-used" }], //不能有声明后未被使用的变量或参数
  27. "no-var": "error", //禁用var,用let和const代替
  28. semi: [2, "always"], //语句强制分号结尾
  29. },
  30. };