首页 > 技术文章 > 不符合eslint6标准修改

wangyuxue 2019-11-28 14:26 原文

一、解决办法

加注释

 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:是关闭的语法规则

推荐阅读