简体   繁体   English

Tslint:简单语法检查

[英]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 lintnpm run lint运行棉绒。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 tslint指出的“as syntax”是什么? - What is the “as syntax” pointed out by tslint? 是否有 TSLint 规则来检查单个等于? - Is there a TSLint Rule to check for single equals? 是否有禁止前缀类型断言语法的 TSLint 规则? - Is there a TSLint rule that forbids the prefixed type assertion syntax? TSLint错误“通过此简单迭代,预期了'for-of'循环而不是'for'循环” - TSLint Error “Expected a 'for-of' loop instead of a 'for' loop with this simple iteration” [tslint] 使用这个简单的迭代(prefer-for-of)期望使用“for-of”循环而不是“for”循环 - [tslint]Expected a 'for-of' loop instead of a 'for' loop with this simple iteration (prefer-for-of) tslint 检查每个文件的开头是否存在特定的字符串 - tslint to check each file if there is specific string present at the start of the file 如何在TSLint中强制执行空白检查分支的相反操作? - How do I enforce the opposite of whitespace check-branch in TSLint? 自定义TSLint规则检查函数参数可赋值性(无双变量) - Custom TSLint rule to check function parameter assignability (no bivariance) tslint 和 prettier 冲突使用 tslint 规则 - tslint and prettier conflict use tslint rules 包裹别名未注册到 tslint - Parcel alias not registering with tslint
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM