1.0.0 • Published 9 years ago

eslint-plugin-no-constant-expressions v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

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 < 2.1;

The following patterns are considered warnings:

a * 0 + 5;
a > 1 && a < 1;
a !== a;