SonarTsPlugin icon indicating copy to clipboard operation
SonarTsPlugin copied to clipboard

Is TSlint rules with typechecking supported?

Open 304NotModified opened this issue 8 years ago • 1 comments

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?

304NotModified avatar Jul 05 '17 21:07 304NotModified

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.

Pablissimo avatar Jul 08 '17 10:07 Pablissimo