如何在Ionic2 / Angular2上禁用“未使用的导入”警告 [英] How to disable 'Unused import'-warnings on Ionic2 / Angular2

查看:217
本文介绍了如何在Ionic2 / Angular2上禁用“未使用的导入”警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道在运行 ionic serve 时,可以选择禁用 tslint 提供的未使用导入警告或离子构建。但我不知道该把它放在哪里。有人知道吗?谢谢

I know there is an option to disable those 'Unused Import' warnings give by tslint when running ionic serve or ionic build. But I have no idea where to put it. Does anyone know? Thanks

[1] https://palantir.github.io/tslint/rules/no-unused-variable/

推荐答案

好的,那很快..像往常一样。我正在寻找解决方案的日子,但在我在这里发布问题之后,我立即找到了解决方案。

Ok, that was quick.. Like often. I'm looking for days for a solution, but immediately after I post my question here, I find the solution on my own.

因此,对于所有人都有同样的问题在开发过程中,您可以在文件 tslint中将 no-unused-variable 设置为 false 。 json

So, for all having the same problems during developing, you can set no-unused-variable to false in the file tslint.json.

但是当你去生产时别忘了再次启用它。

But don't forget to enable it again when you go to production.

这篇关于如何在Ionic2 / Angular2上禁用“未使用的导入”警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆