在利用vue-cli3+构建的项目中引入eslint进行语法检查时,使用console.log('xxx')时,控制台抛出了 Unexpected console statement (no-console) 异常,解决办法是:

在项目的package.json文件中,eslintConfig 配置项中的“rules”中新增一条配置项即可

"eslintConfig": {
    ...
    "rules": {
        "no-console":"off"
    }

}

 

Logo

前往低代码交流专区

更多推荐