目前在做的一个项目使用了TypeScript,遇到了很多问题,在这里简单记录一下问题的出现和解决方案
1. Calls to 'console.log' are not allowed 禁止使用console.log
image.png
这里是因为tslint做了限制,在最外层tslint.json中添加no-console: false
image.png
"no-console": false
重启服务即可
2. trailing whitespace 尾部空格
image.png
同理,也需要在tslint中取消限制"no-trailing-whitespace": false,
image.png
重启服务即可