如何使用Angular Cli运行tslint?

前端之家收集整理的这篇文章主要介绍了如何使用Angular Cli运行tslint?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当我试图从Angular Cli运行tslint时,我遇到了问题.

> ng lint

错误

Failed to load E:\Projects\lsp-ui\node_modules\ng2-slimscroll\tslint.json: Could not find custom rule directory: E:\Projects\lsp-ui\node_modules\ng2-slimscroll\node_modules\codelyzer

[运行时出错]

enter image description here

解决方法

首先运行npm install或npm install codelyzer.

还要检查Angular Cli配置lint部分中tsconfig.json的文件路径,tslint.json中rules规则的配置,例如:

“rulesDirectory”:[        “../node_modules/codelyzer”    ]

猜你在找的Angularjs相关文章