org.sonar.l10n.javascript.rules.javascript.S4137.html Maven / Gradle / Ivy
Type assertion can be done in two ways: with as MyType
or with <MyType>
. But since there is an ambiguity in the
latter when using JSX and there is no ambiguity in the former, as
is preferred.
Noncompliant Code Example
var foo = <any>"foo"; // Noncompliant
Compliant Solution
var foo = "foo" as any;