关闭ESLint警告

默认情况下,ESLint和vscode格式化工具有冲突,需要添加配置文件解决冲突。

1、在项目根目录添加 .prettierrc 文件

{
"semi":false,
"singleQuote":true
}

打开.eslintrc.js文件,禁用对 space-before-function-paren 的检查:

rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'space-before-function-paren' : 0
},

注释掉.eslintrc.js文件中的’@vue/standard’可能出现每个框架的名字不同。

如我在vue3.0_antd中是@vue/prettier

  extends: ['plugin:vue/vue3-essential', 'eslint:recommended', '@vue/prettier'],
 
2、或者vue.config.js中将以下三项设置为false
    overlay: {
      warnings: false,
      errors: false,
    },
lintOnSave: false,
原文地址:https://www.cnblogs.com/huoshengmiao/p/14601566.html