In this section
Introduction
Parasoft supports TypeScript by integrating with TSLint, an open source tool that performs static analysis on TypeScript code for readability, maintainability, and functionality errors. Visit the TSLint website for additional information about the tool: https://palantir.github.io/tslint/.
The Parasoft TSLint extension processes the result file output from your TSLint execution, generates reports showing violations and severities for the code authors, and sends the data to Parasoft DTP. DTP presents the data in widgets, reports, and other interfaces that enable you to prioritize violations, place them into remediation workflows, and monitor progress toward improving the code quality.
Requirements
- TSLint version 6.1.3 is currently supported.
- TSLint should be installed, successfully running analysis, and producing reports in JSON format. To output a JSON file, use --
format json --out tslint-results.json
to your execution. For example:
tslint -c tslint.json --format json --out tslint-results.json 'src/**/*.ts'
Usage
- If you have not already done so, execute TSLint and verify that the results are output to a file in JSON format.
- Open a command prompt and navigate to the Multi-Language Pack installation directory.
- Execute the multilanguage-pack.bat or multilanguage-pack.sh script with the required parameters all on one line, e.g.:
multilanguage-pack.bat -tool tslint -results.file "/path/to/tslint-results.json" -source.dir "/path/to/directory/src"
Internal technical log files from the Multi-Language Pack execution are generated in the <INSTALL>/.mlp subdirectory.
Required Parameters
The following settings are required.
tool
This setting specifies the Parasoft extension to execute. Use -tool tslint
to run the TSLint extension.
results.file
Specifies the path to the TSLint analysis results file.
source.dir
Specifies the path to the folder containing the analyzed TSLint source code. This is used to collect source control metadata (e.g., authorship, last updated, etc.) for DTP reporting and processing.