diff --git a/README.md b/README.md index fcb6090..cf141fc 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,10 @@ Suggestions for more projects (or ones with easy-to-gather code coverage info) a * [Microsoft Visual Studio Code](https://sonar.pablissimo.com/overview?id=19179) * [Angular Framework](https://sonar.pablissimo.com/overview?id=18822) +###Integrations + +* [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) + ##Overview 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 * Browse to SonarQube web interface, login as Admin, hit up Settings * Find the TypeScript tab, paste in the TsLint path * Hit the Rules tab, then the TsLint rule set, then apply it to your project - alter rule activation as required -* Add *sonar.ts.tslintconfigpath=tslint.json* to your sonar-project.properties file - change the path as required, relative to your properties file +* Make sure you have a ```tslint.json``` file next to ```sonar-project.properties```, or specify its path using the ```sonar.ts.tslintconfigpath``` setting * 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) * Run sonar-runner * 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 KeyDescription -sonar.ts.tslintpathMandatoryPath to the installed copy of TsLint to use +sonar.ts.tslintpathRecommendedPath to the installed copy of TsLint to use - can also be set at project level, see note below sonar.ts.ruleconfigsOptionalA list of configurations to map custom TsLint rules to dedicated SonarQube rules & settings - see TsLint Custom Rules section below @@ -80,6 +84,7 @@ The plugin has so far *only been tested on Windows* and it'll be no surprise if KeyDescription +sonar.ts.tslintpathRecommendedPath to the installed copy of TsLint to use - see note below sonar.ts.tslintconfigpathMandatoryPath to the tslint.json file that configures the rules to be used in linting sonar.ts.excludetypedefinitionfilesOptionalExcludes .d.ts files from analysis, defaults to true sonar.ts.forceZeroCoverageOptionalForces code coverage percentage to zero when no report is supplied, defaults to false @@ -90,6 +95,13 @@ The plugin has so far *only been tested on Windows* and it'll be no surprise if +##TsLint installation and configuration +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: +* At project level +* Globally, for all projects + +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```. + ## TsLint Custom Rules To present custom TsLint rules in SonarQube analysis, you can provide a configuration that maps the TsLint rules from your `sonar.ts.tslintrulesdir`