42 lines
804 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-01-27 13:42:22 +01:00
Boolean literals should be avoided in comparison expressions ``++==++`` and ``++!=++`` to improve code readability.
2021-02-02 15:02:10 +01:00
This rule also reports on redundant boolean operations.
=== Noncompliant code example
2022-02-04 17:28:24 +01:00
[source,javascript]
----
let someValue = "0";
// ...
if (someValue == true) { /* ... */ }
if (someBooleanValue != true) { /* ... */ }
doSomething(!false);
----
=== Compliant solution
2022-02-04 17:28:24 +01:00
[source,javascript]
----
if (someValue && someValue != "0") { /* ... */ }
if (!someBooleanValue) { /* ... */ }
doSomething(true);
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]