SonarTS
SonarTS copied to clipboard
Static code analyzer for TypeScript
**I want to request a feature.** In TypeScript you can use JSDoc: ```typescript /** * Gets the weekday for a given date * @param date * @param {Language} language *...
See #482, Reported in #828 ```ts const right = { error: true as true // cast is flagged as unnecessary } typeof right.error // true const wrong = { error:...
**I want to request a feature.** Typescript noUnusedParameters option ignores params beginning with underscore (understand that some people dislike this, but this is how it is). For such params that...
https://palantir.github.io/tslint/rules/no-namespace/ RSPEC to be defined
``` const message = "Hello, world!"; console.log("Hello, world!"); // Noncompliant, use constant ```
Current implementation of [RSPEC-3801](https://jira.sonarsource.com/browse/RSPEC-3801) should cover [union types](https://www.typescriptlang.org/docs/handbook/advanced-types.html#union-types) when using switch, as described in specification about [exhaustiveness checking](https://www.typescriptlang.org/docs/handbook/advanced-types.html#exhaustiveness-checking). For instance: ```typescript type Shape = Square | Rectangle | Circle |...
Implements [RSPEC-1659](https://jira.sonarsource.com/browse/RSPEC-1659)
**I want to request a feature.** **Rule key:** S122/no-statements-same-line Would be nice if the rule above had a configuration allowing to disable it for some statements like this: ```json …...
**I want to report a bug.** The bug is about "magic numbers" inside of strings written in backticks ( `) **SonarTS version:** 1.8 **Node.js version:** 10.11.0 **TypeScript version:** 3.1.6 **Reproducer**...
When defining a `enum`, its properties can be defined using any format, some examples ```ts enum UpperCamelCase { FooBar, Baz } enum CamelCase { fooBar, Baz } enum Caps {...