Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

Latest commit

 

History

History
22 lines (17 loc) · 916 Bytes

terNoSelfCompareRule.md

File metadata and controls

22 lines (17 loc) · 916 Bytes

ter-no-self-compare (ESLint: no-self-compare)

rule_source test_source

disallow comparisons where both sides are exactly the same

Rationale

Comparing a variable against itself is usually an error, either a typo or refactoring error. It is confusing to the reader and may potentially introduce a runtime error.

Config

Examples

"ter-no-self-compare": true

Schema

{}