---
source: crates/oxc_linter/src/tester.rs
expression: no_redeclare
---
  ⚠ eslint(no-redeclare): 'b' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ switch(foo) { case a: var b = 3;
   ·                           ┬
   ·                           ╰── 'b' is already defined.
 2 │ case b: var b = 4}
   ·             ┬
   ·             ╰── It can not be redeclare here.
   ╰────

  ⚠ eslint(no-redeclare): 'b' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ switch(foo) { case a: var b = 3;
   ·                           ┬
   ·                           ╰── 'b' is already defined.
 2 │ case b: var b = 4}
   ·             ┬
   ·             ╰── It can not be redeclare here.
   ╰────

  ⚠ eslint(no-redeclare): 'a' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ var a = 3; var a = 10;
   ·     ┬          ┬
   ·     │          ╰── It can not be redeclare here.
   ·     ╰── 'a' is already defined.
   ╰────

  ⚠ eslint(no-redeclare): 'a' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ var a = {}; var a = [];
   ·     ┬           ┬
   ·     │           ╰── It can not be redeclare here.
   ·     ╰── 'a' is already defined.
   ╰────

  × Identifier `a` has already been declared
   ╭─[no_redeclare.tsx:1:1]
 1 │ var a; function a() {}
   ·     ┬           ┬
   ·     │           ╰── It can not be redeclared here
   ·     ╰── `a` has already been declared here
   ╰────

  × Identifier `a` has already been declared
   ╭─[no_redeclare.tsx:1:1]
 1 │ function a() {} function a() {}
   ·          ┬               ┬
   ·          │               ╰── It can not be redeclared here
   ·          ╰── `a` has already been declared here
   ╰────

  ⚠ eslint(no-redeclare): 'a' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ var a = function() { }; var a = function() { }
   ·     ┬                       ┬
   ·     │                       ╰── It can not be redeclare here.
   ·     ╰── 'a' is already defined.
   ╰────

  ⚠ eslint(no-redeclare): 'a' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ var a = function() { }; var a = new Date();
   ·     ┬                       ┬
   ·     │                       ╰── It can not be redeclare here.
   ·     ╰── 'a' is already defined.
   ╰────

  ⚠ eslint(no-redeclare): 'a' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ var a = 3; var a = 10; var a = 15;
   ·     ┬          ┬
   ·     │          ╰── It can not be redeclare here.
   ·     ╰── 'a' is already defined.
   ╰────

  ⚠ eslint(no-redeclare): 'a' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ var a = 3; var a = 10; var a = 15;
   ·     ┬                      ┬
   ·     │                      ╰── It can not be redeclare here.
   ·     ╰── 'a' is already defined.
   ╰────

  ⚠ eslint(no-redeclare): 'a' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ var a; var a;
   ·     ┬      ┬
   ·     │      ╰── It can not be redeclare here.
   ·     ╰── 'a' is already defined.
   ╰────

  ⚠ eslint(no-redeclare): 'a' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ export var a; var a;
   ·            ┬      ┬
   ·            │      ╰── It can not be redeclare here.
   ·            ╰── 'a' is already defined.
   ╰────

  ⚠ eslint(no-redeclare): 'a' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ class C { static { var a; var a; } }
   ·                        ┬      ┬
   ·                        │      ╰── It can not be redeclare here.
   ·                        ╰── 'a' is already defined.
   ╰────

  ⚠ eslint(no-redeclare): 'a' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ var a; var {a = 0, b: Object = 0} = {};
   ·     ┬       ┬
   ·     │       ╰── It can not be redeclare here.
   ·     ╰── 'a' is already defined.
   ╰────

  ⚠ eslint(no-redeclare): 'a' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ var a; var {a = 0, b: globalThis = 0} = {};
   ·     ┬       ┬
   ·     │       ╰── It can not be redeclare here.
   ·     ╰── 'a' is already defined.
   ╰────

  ⚠ eslint(no-redeclare): 'a' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ function f() { var a; var a; }
   ·                    ┬      ┬
   ·                    │      ╰── It can not be redeclare here.
   ·                    ╰── 'a' is already defined.
   ╰────

  ⚠ eslint(no-redeclare): 'a' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ function f(a) { var a; }
   ·            ┬        ┬
   ·            │        ╰── It can not be redeclare here.
   ·            ╰── 'a' is already defined.
   ╰────

  ⚠ eslint(no-redeclare): 'a' is already defined.
   ╭─[no_redeclare.tsx:1:1]
 1 │ for (var a, a;;);
   ·          ┬  ┬
   ·          │  ╰── It can not be redeclare here.
   ·          ╰── 'a' is already defined.
   ╰────


