[英]Doubts with TSLint
I have some doubts with TSLint with ionic. 我对TSLint和ionic有一些疑问。
I have installed official TSLint rules for ionic from: 我已经从以下位置为离子安装了官方TSLint规则:
https://github.com/ionic-team/tslint-ionic-rules https://github.com/ionic-team/tslint-ionic-rules
Then I have installed globally tslint with: 然后我用以下命令全局安装了tslint:
npm install tslint typescript -g
How can I test my project and obtain the results with the CLI? 如何使用CLI测试项目并获得结果?
I have already tried with: 我已经尝试过:
tslint -p /pathToRootProject > test.txt
But I am not sure if this is correct way. 但是我不确定这是否正确。
On the other hand I have tried to do: 另一方面,我尝试做:
tslint --fix semicolon
But it returns: 但它返回:
'semicolon' does not exist. This will be an error in TSLint 6.
What I am doing wrong? 我做错了什么?
Thanks 谢谢
I use the following command line to work with my project. 我使用以下命令行处理我的项目。
tslint --config ./tslint.json --project ./tsconfig.json --force --format stylish
--config and point to my tslint.json file with all the different rules I want to enforce. --config并指向我的tslint.json文件,其中包含我要执行的所有不同规则。
--project uses the tsconfig.json, Typescript configuration for which files to build, options in Typescript to use with Linting, etc. --project使用tsconfig.json,要为其生成文件的Typescript配置,要与Linting一起使用的Typescript选项等。
--force will return a status code of 0 (no errors even if the linter finds some) so my build process will continue. --force将返回状态代码0(即使linter发现错误也没有错误),因此我的构建过程将继续。
--format to use the stylish formatter to get a nicer output that I prefer to use to clean up my code. --format使用时尚的格式化程序来获得更好的输出,我更喜欢使用该输出来清理代码。
The complete TSLint command line interface guide is here. 完整的TSLint命令行界面指南在这里。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.