Disallow use of constant expressions (no-constant-expressions)
This is a working proof of concept. The code is crazy stream of consciousness.
Dynamically calculating a constant is likely to be an error.
var success = a === a;
This pattern is most likely an error.
Rule Details
The rule is aimed at preventing the use of a constant expression.
Examples
The following patterns are considered okay and do not cause warnings:
a === 3;a === true && b === a;2 < a && a < 21;
The following patterns are considered warnings:
a * 0 + 5;a > 1 && a < 1;a !== a;