SonarTsPlugin
SonarTsPlugin copied to clipboard
WARN - Path to tslint not defined or not found. Skipping tslint analysis.
@Pablissimo. My Sonar Job is success but tslint is not viewable in SonarQube
Analysis Properties: sonar.projectKey=sonar:Member2DevWeb sonar.projectName=MyRetirement_member2_dev/member sonar.projectVersion=Member2DevWeb sonar.sources=member/src sonar.exclusions=member/src/lib//*, member/src/assets//* sonar.language=ts sonar.ts.tslintpath=node_modules/tslint/bin sonar.ts.excludetypedefinitionfiles=true sonar.ts.tslintconfigpath=tslint.json sonar.supportSourceFileDuplications=false sonar.issuesReport.html.enable=true sonar.issuesReport.console.enable=true
The warning indicates tslint wasnt found in the specific folder you supplied, which needs to be specified relative to the sonar-project.properties file (or the analysis working directory if it has been overridden).
What version of the plugin are you using?
TypeScript version 1.1.0 From this link https://github.com/Pablissimo/SonarTsPlugin/releases and install the sonar-typescript-plugin-1.1.0.jar
Should this help 07:29:55.945 DEBUG - Found sonar.ts.tslint.path path to be 'node_modules/tslint/bin' 07:29:55.945 DEBUG - Found sonar.ts.tslint.configPath path to be 'tslint.json' 07:29:55.945 DEBUG - Path sonar.ts.tslint.rulesDir not specified, falling back to null 07:29:55.946 DEBUG - Path sonar.ts.tslint.projectPath not specified, falling back to null 07:29:55.946 DEBUG - Path sonar.ts.tslint.outputPath not specified, falling back to null 07:29:55.946 WARN - Path to tslint not defined or not found. Skipping tslint analysis.
Do you execute npm i
or npm i --only=dev
on your "Sonar job" before you run sonar-scanner?
No,
I think this is related to required version of TsLint? In our SonarQube I can't see TsLint installed
Requirements: Java 1.8+ SonarQube 5.6 LTS+ TsLint 2.4.0+
The above log suggests that you've configured the sonar-project.properties correctly, but that there's no file at node_modules/tslint/bin.
Note - the plugin doesn't ship with a version of tslint
nor really is any specific version required beyond 'something fairly recent'. The error you're getting suggests that it can't find any version of tslint
at the path you've specified.
Things to check/answer:
- Relative to the sonar-project.properties file, is there anything at node_modules/tslint/bin? Does specifying an absolute path help?
- If you're running this as part of a CI build, the
npm -i
comment is a good one if you don't typically check node_modules into your source control - are you seeing this trouble as part of a CI build or locally too? - Does the user account running the analysis have access to the node_modules/tslint/bin folder? Are there any permissioning issue around it?
I had the same warning, and the problem for me was a typo in the config: sonar.ts.tslintpath (same as the OP) should be sonar.ts.tslint.path
Hi, I am using SonarQube 5.6 and TypeScript plugin is sonar-typescript-plugin-1.1.0 Jenkins version is 1.6. And SonarRunner version is sonar-runner2.4 But it doesn't seem to scan the .TS files. Please help.
The excerpt output in Jenkins is as below:
12:16:17.973 INFO - Sensor Lines Sensor 12:16:18.004 INFO - Sensor Lines Sensor (done) | time=31ms 12:16:18.004 INFO - Sensor SCM Sensor 12:16:18.004 INFO - SCM Publisher is disabled 12:16:18.004 INFO - Sensor SCM Sensor (done) | time=0ms 12:16:18.004 INFO - Sensor Linting sensor for TypeScript files 12:16:21.115 INFO - Sensor Linting sensor for TypeScript files (done) | time=3111ms 12:16:21.115 INFO - Sensor Combined LCOV and LOC sensor 12:16:21.193 INFO - Sensor Combined LCOV and LOC sensor (done) | time=78ms 12:16:21.193 INFO - Sensor Zero Coverage Sensor 12:16:21.224 INFO - Sensor Zero Coverage Sensor (done) | time=31ms 12:16:21.224 INFO - Sensor Code Colorizer Sensor 12:16:21.224 INFO - Sensor Code Colorizer Sensor (done) | time=0ms 12:16:21.224 INFO - Sensor CPD Block Indexer 12:16:21.224 INFO - DefaultCpdBlockIndexer is used for ts 12:16:21.224 INFO - Sensor CPD Block Indexer (done) | time=0ms 12:16:21.224 INFO - Calculating CPD for 0 files 12:16:21.239 INFO - CPD calculation finished
I have used this line:
sonar.ts.tslint.path=node_modules/tslint/bin/tslint
Of course, only after installing tslint locally:
npm install --save-dev tslint