Linux command
tslint 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Lint files
tslint [file.ts]
Lint with config
tslint -c [tslint.json] [file.ts]
Fix automatically
tslint --fix [file.ts]
Lint project
tslint -p [tsconfig.json]
Output as JSON
tslint --format json [file.ts]
Lint all TypeScript
tslint -p . "[src/**/*.ts]"
说明
TSLint was a static analysis tool for TypeScript that checked code for readability, maintainability, and functional correctness. It enforced configurable rules covering style conventions, potential errors, and best practices. The tool supported automatic fixing of many rule violations and integrated with editors and CI systems. Configuration was managed through a tslint.json file that specified which rules to enable and their severity levels. TSLint was deprecated in 2019 in favor of ESLint with the typescript-eslint plugin, which provides the same TypeScript linting capabilities within the more widely adopted ESLint ecosystem.
参数
- -c _FILE_
- Config file.
- -p _FILE_
- Project tsconfig.
- --fix
- Auto-fix issues.
- --format _FMT_
- Output format.
- -e _PATTERN_
- Exclude pattern.
FAQ
What is the tslint command used for?
TSLint was a static analysis tool for TypeScript that checked code for readability, maintainability, and functional correctness. It enforced configurable rules covering style conventions, potential errors, and best practices. The tool supported automatic fixing of many rule violations and integrated with editors and CI systems. Configuration was managed through a tslint.json file that specified which rules to enable and their severity levels. TSLint was deprecated in 2019 in favor of ESLint with the typescript-eslint plugin, which provides the same TypeScript linting capabilities within the more widely adopted ESLint ecosystem.
How do I run a basic tslint example?
Run `tslint [file.ts]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -c _FILE_ do in tslint?
Config file.