设置 ESlint 规则
module.exports = {
root: true,
env: {
node: true,
},
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
parserOptions: {
parser: "babel-eslint",
},
rules: {
"no-func-assign": 2,
"space-before-function-paren": [0, "always"],
"no-multiple-empty-lines": [1, { max: 2 }],
"no-nested-ternary": 0,
"no-new": 1,
"no-new-wrappers": 2,
"no-redeclare": 2,
"no-spaced-func": 2,
"no-undef": 0,
"no-underscore-dangle": 0,
"no-use-before-define": 2,
"no-var": 2,
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"comma-style": [2, "last"],
"new-cap": 2,
"semi": [2, "always"],
"strict": 0,
},
};
配置 webstorm
- CTRL+ALT+S 调用设置面板
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/12675b0b225940709c1009c1cc0ec811.png#pic_center)
参考链接
- https://blog.csdn.net/weixin_46990115/article/details/122224726
- https://juejin.cn/post/6844904041747578894