TypeScript custom rules let you define specific type-checking, compilation, and linting rules in a configuration file. These rules help improve code quality, reduce errors, and enforce a consistent team-wide coding style.
Add a TSLint code scan task
On the pipeline editing page, click parallel task and select TSLint code scan from the right-hand drawer.
Use custom rules
By default, Flow uses standard TSLint rules. To use your own custom rules, add a tslint.json file to your project root.
To learn more about rules, see the TSLint Official Documentation.
-
To generate a
tslint.jsonfile for the first time, run the following command:tslint --init -
Click save and run. The TSLint code scan task automatically uses the
tslint.jsonfile in your project root.
该文章对您有帮助吗?