如何解决TSLint:关于现有规则的自定义错误消息
我想使用ts-lint的规则no-console,并附带一些自定义错误消息。
该想法是为开发人员提供更加用户友好的输出,并使他们使用我们的工具而不是控制台进行日志记录。
代替这样的事情
> npm run lint
ERROR: src/app/app.component.ts:84:5 - Calls to 'console.info' are not allowed.
我希望拥有这个
> npm run lint
ERROR: src/app/app.component.ts:84:5 - Calls to 'console.info' are not allowed.
You should only use console.log for local development,and you have probably forgotten
to remove this line.
If you want to have logs on production or preproduction,please use instead the
`Logger` class. To know more about this Logger,please refer to this documentation <link>.
是否有可能?以及如何做到这一点?
谢谢!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。