Vue报错error: Unexpected console statement (no-console) - 起点终站

我们应该感谢相遇,无论结局是喜是悲....
Vue报错error: Unexpected console statement (no-console)
  • 首页 > IT技术
  • 作者:起点终站
  • 2019年12月12日 16:46 星期四
  • 浏览:18096
  • 字号:
  • 评论:2
  • 写项目过程中用ESLint遵守代码规范很有必要,但是对于一些规范也很是无语,比如:‘Unexpected console statement (no-console)’,连console都不能用,这就很抓狂了。其实增加一行代码即可。

    修改package.json中的eslintConfig:{} 中的 “rules”:{},增加一行代码: "no-console":"off"

    示例:

    "eslintConfig": {
      "root": true,
        "env": {
        "node": true
      },
      "extends": [
        "plugin:vue/essential",
        "eslint:recommended"
      ],
      "rules": {
        "no-console":"off"
      },
      "parserOptions": {
        "parser": "babel-eslint"
      }
    }


      您阅读这篇文章共花了:  
    本文作者:起点终站      文章标题: Vue报错error: Unexpected console statement (no-console)
    本文地址:https://blog.hellozwh.com/?post=442
    版权声明:若无注明,本文皆为“起点终站”原创,转载请保留文章出处。
    • blogger
    pdd2020-04-06 10:52
    拼多多空包 88单号网 全国任意发货 24小时自助下单www.88danhw.com
    yang2019-12-24 17:38
    这些都是配置eslint就能解决的问题吧
    返回顶部| 首页| 手气不错| 网站地图| sitemap| 装逼生成器| 站长介绍|

    Copyright © 2016-2019 起点终站 闽ICP备16011094号-1