1234567891011121314151617181920212223242526272829303132333435363738 |
- /*
- * @Author: PoJun
- * @Date: 2023-05-14 16:31:46
- * @LastEditors: PoJun
- * @LastEditTime: 2023-05-14 16:32:06
- * @Message: Nothing
- */
- module.exports = {
- root: true,
- env: {
- node: true,
- },
- extends: ["plugin:vue/essential", "eslint:recommended"],
- parserOptions: {
- parser: "babel-eslint",
- },
- //"off"或者0 关闭规则关闭
- //"warn"或者1 在打开的规则作为警告(不影响退出代码)
- //"error"或者2 把规则作为一个错误(退出代码触发时为1
- rules: {
- "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
- "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
- "no-alert": 0, //禁止使用alert confirm prompt
- "no-empty": 2, //块语句中的内容不能为空
- "no-nested-ternary": 0, //禁止使用嵌套的三目运算
- "no-redeclare": 2, //禁止重复声明变量
- "no-spaced-func": 2, //函数调用时 函数名与()之间不能有空格
- "no-unreachable": 2, //不能有无法执行的代码
- "no-unused-vars": [2, { vars: "all", args: "after-used" }], //不能有声明后未被使用的变量或参数
- "no-var": 0, //禁用var,用let和const代替
- curly: [2, "all"], //必须使用 if(){} 中的{}
- semi: [2, "always"], //语句强制分号结尾
- },
- globals: {
- uni: null,
- wx: null,
- },
- };
|