This rule checks that the var keyword is not used to declare a variable with a name that is already in use. It applies to already defined variables as well as to function parameters.

This use of duplicate name is often unwanted and can lead to bugs and more generally to confusing code :


== Noncompliant Code Example

----
var a = 'foo';
var a = 'bar'; // Noncompliant

function f(e) {
  var e = "event"; // Noncompliant
}
----


== Compliant Solution

----
var a = 'foo';
var b = 'bar';

function f(e) {
  var g = "event";
}
----


