Pablissimo / SonarTsPlugin

SonarQube plugin for TypeScript files
MIT License
185 stars 106 forks source link

Is TSlint rules with typechecking supported? #158

Open 304NotModified opened 7 years ago

304NotModified commented 7 years ago

Some TSLint rules Requires Type Info

I'm trying the rule "completed-docs" which needs type info (gulp told me, the docs are wrong)

When running with gulp it works, but not in Sonar it doesn't show the warnings.

Is this something that should work?

Pablissimo commented 7 years ago

Yep, but the only mechanism that lets it work in tslint is to specify a single project file to analyse, rather than individual .ts files. Seems that's not been documented in the readme though so I'll fix that just now, but in essence you need to tack the following configuration into your sonar-project.properties:

sonar.ts.tslint.projectPath=path\to\tsconfig.json sonar.ts.tslint.typeCheck=true

That will cause the plugin to only analyse the files described by your tsconfig.json but will then supply the relevant arguments to tslint to support type-check-required rules.