在项目目录下找到.eslintrc.js文件,使用编辑器打开进行编辑。在rules下添加space-before-function-paren、space-before-blocks、及semi的配置。
module.exports = { root: true, env: { node: true }, 'extends': [ 'plugin:vue/essential', '@vue/standard' ], rules: { 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', "space-before-function-paren": ["error", { "anonymous": "always", "named": "always", "asyncArrow": "always" }], "space-before-blocks": ["error", { "functions": "never", "keywords": "always", "classes": "never" }], 'semi': ["error", "always"] }, parserOptions: { parser: 'babel-eslint' } }