vue tslint报错: Calls to 'console.log' are not allowed

使用Vue CLI 3 的 vue create 创建vue+ts 项目,使用默认配置, 控制台报警告Calls to 'console.log' are not allowed,解决

在tslint.json中的rules下 添加: "no-console": false。无需向在tsling.config中添加"extends":"./tslint.config"。重启服务,搞定。

附tslint.json文件:

 
{
  "defaultSeverity": "warning",
  "extends": [
    "tslint:recommended"
  ],
  "linterOptions": {
    "exclude": [
      "node_modules/**"
    ]
  },
  "rules": {
    "quotemark": [true, "single"],
    "indent": [true, "spaces", 2],
    "interface-name": false,
    "ordered-imports": false,
    "object-literal-sort-keys": false,
    "no-consecutive-blank-lines": false,
    "max-line-length": [ false ],
    "no-console": false
  }
}
原文地址:https://www.cnblogs.com/changfeng1800/p/10985875.html