Skip to content

Files

Latest commit

 

History

History
13 lines (7 loc) · 493 Bytes

no-duplicate-variable.md

File metadata and controls

13 lines (7 loc) · 493 Bytes

Pattern: Duplicate variable

Issue: -

Description

Disallows duplicate variable declarations in the same block scope. This rule is only useful when using the var keyword - the compiler will detect redeclarations of let and const variables.

Rationale: A variable can be reassigned if necessary - there’s no good reason to have a duplicate variable declaration.

Further Reading