【发布时间】:2020-10-27 23:22:34
【问题描述】:
我正在尝试为我的新 vue cli 项目设置 eslint。它不起作用。它通过了,但我没有发现我有意添加的错误。任何想法我做错了什么?
vue.config.js
devServer: {
overlay: {
warnings: true,
errors: true,
},
},
lintOnSave: true,
.eslintrc.js
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
parserOptions: {
parser: "babel-eslint",
},
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
plugins: ["prettier"],
// add your custom rules here
rules: {
semi: "error",
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
},
};
src/App.vue:
...
methods: {
test() {
return true;
},
},
...
vue-cli-service lint 结果:
> project@0.1.0 lint /project/location/component_library
> vue-cli-service lint
DONE No lint errors found!
【问题讨论】:
标签: javascript vue.js vue-cli