[英]Tslint: simple syntax check
How can I use tslint to do a simple syntax check of my project ? 如何使用tslint对项目进行简单的语法检查? At the moment, I don't want to enforce other style/code rules.
目前,我不想执行其他样式/代码规则。 My tslint.json is:
我的tslint.json是:
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {},
"rulesDirectory": []
}
To run linting separately from other build steps, I typically add a lint
script to package.json
, like so: 为了与其他构建步骤分开运行linting,通常会在
package.json
添加一个lint
脚本,如下所示:
"scripts": {
"lint": ".\\node_modules\\.bin\\tslint src\\**\\*.ts**"
}
Then yarn lint
or npm run lint
to run the linter. 然后用
yarn lint
或npm run lint
运行棉绒。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.