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 (将#修改为@)