SonarTS Profiles contain way fewer rules than JS…should I analyze my dist/ folders?

javascript
typescript
sonarqube

(Ian G.) #1

A number of important rules do not appear to be provided in the typescript quality profile, but do exist in the javascript profile. That would be fine if they were caught by the typescript compiler, but many are not. Examples:

  • Conditionally executed blocks should be reachable (javascript:S2583)
  • Collection sizes and array length comparisons should make sense (javascript:S3981)

I could catch this sort of thing by scanning the compiled javascript code, but that seems less than ideal as we would then have to find and fix it in the the typescript source. Is there a better solution that I’m missing here?