關閉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,


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM