不符合eslint6標准修改


一、解決辦法

加注釋

 if (!values.every(value => isNaN(value))) { // eslint-disable-line
加注釋:eslint-disable-line可以跳過eslint6標准判斷
 
二、文件設置
文件名:.eslintrc.js
'rules': {
    'global-require': 0,
    'import/no-unresolved': 0,
    'no-param-reassign': 0,
    'no-shadow': 0,
    'import/extensions': 0,
    'import/newline-after-import': 0,
    'no-multi-assign': 0,
    // allow debugger during development
    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
    // TODO:以下內容需優化
    'linebreak-style': 'off',
    'no-plusplus': 0,
    'arrow-body-style': 0,
    'prefer-destructuring': 0,
    'no-restricted-globals': 0,
  }
設置'no-restricted-globals': 0:是關閉的語法規則


免責聲明!

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



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