Skip to content
This repository was archived by the owner on Jul 8, 2019. It is now read-only.

Commit 54f23e6

Browse files
committed
Merge branch 'master' of github.com:Pablissimo/SonarTsPlugin
2 parents b34e86a + 442ee87 commit 54f23e6

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Suggestions for more projects (or ones with easy-to-gather code coverage info) a
1818
* [Microsoft Visual Studio Code](https://sonar.pablissimo.com/overview?id=19179)
1919
* [Angular Framework](https://sonar.pablissimo.com/overview?id=18822)
2020

21+
###Integrations
22+
23+
* [Running TSLint within SonarQube on a TFS build](http://blogs.blackmarble.co.uk/blogs/rfennell/post/2016/07/05/Running-TSLint-within-SonarQube-on-a-TFS-build) - [Richard Fennell](https://github.com/rfennell)
24+
2125
##Overview
2226

2327
This is a **not even alpha-level yet** SonarQube plugin for analysing projects with TypeScript content that supports:
@@ -55,7 +59,7 @@ The plugin has so far *only been tested on Windows* and it'll be no surprise if
5559
* Browse to SonarQube web interface, login as Admin, hit up Settings
5660
* Find the TypeScript tab, paste in the TsLint path
5761
* Hit the Rules tab, then the TsLint rule set, then apply it to your project - alter rule activation as required
58-
* Add *sonar.ts.tslintconfigpath=tslint.json* to your sonar-project.properties file - change the path as required, relative to your properties file
62+
* Make sure you have a ```tslint.json``` file next to ```sonar-project.properties```, or specify its path using the ```sonar.ts.tslintconfigpath``` setting
5963
* If LCOV data available, add *sonar.ts.lcov.reportpath=lcov.dat* to your sonar-project.properties file (replace lcov.dat with your lcov output, will be sought relative to the sonar-project.properties file)
6064
* Run sonar-runner
6165
* TsLint rule breaches should be shown in the web view
@@ -68,7 +72,7 @@ The plugin has so far *only been tested on Windows* and it'll be no surprise if
6872
<thead>
6973
<tr><th>Key</th><th></th><th>Description</th></thead>
7074
<tbody>
71-
<tr><td>sonar.ts.tslintpath</td><td><b>Mandatory</b></td><td>Path to the installed copy of TsLint to use</td></tr>
75+
<tr><td>sonar.ts.tslintpath</td><td><b>Recommended</b></td><td>Path to the installed copy of TsLint to use - can also be set at project level, see note below</td></tr>
7276
<tr><td>sonar.ts.ruleconfigs</td><td><b>Optional</b></td><td>A list of configurations to map custom TsLint rules to dedicated SonarQube rules &amp; settings - see TsLint Custom Rules section below</td></tr>
7377
</tbody>
7478
</table>
@@ -80,6 +84,7 @@ The plugin has so far *only been tested on Windows* and it'll be no surprise if
8084
<tr><th>Key</th><th></th><th>Description</th>
8185
</thead>
8286
<tbody>
87+
<tr><td>sonar.ts.tslintpath</td><td><b>Recommended</b></td><td>Path to the installed copy of TsLint to use - see note below</td></tr>
8388
<tr><td>sonar.ts.tslintconfigpath</td><td><b>Mandatory</b></td><td>Path to the tslint.json file that configures the rules to be used in linting</td></tr>
8489
<tr><td>sonar.ts.excludetypedefinitionfiles</td><td><b>Optional</b></td><td>Excludes .d.ts files from analysis, defaults to true</td></tr>
8590
<tr><td>sonar.ts.forceZeroCoverage</td><td><b>Optional</b></td><td>Forces code coverage percentage to zero when no report is supplied, defaults to false</td></tr>
@@ -90,6 +95,13 @@ The plugin has so far *only been tested on Windows* and it'll be no surprise if
9095
</tbody>
9196
</table>
9297

98+
##TsLint installation and configuration
99+
By default, SonarTsPlugin will look for a version of TsLint installed locally within your project (i.e. in node_modules\tslint\bin), relative to the sonar-project.properties file. Thismay not be what you want, so you can set this directly via the ```sonar.ts.tslintpath``` configuration setting:
100+
* At project level
101+
* Globally, for all projects
102+
103+
If analysis is failing, run ```sonar-runner``` with the ```-X -e``` options for more diagnostic information, including a note of where the plugin is searching for ```tslint```. Bear in mind that if running on a build server, the account running the build will need access to the path to ```tslint```.
104+
93105
## TsLint Custom Rules
94106

95107
To present custom TsLint rules in SonarQube analysis, you can provide a configuration that maps the TsLint rules from your `sonar.ts.tslintrulesdir`

0 commit comments

Comments
 (0)