# no-redeclare

Rule `eslint/no-redeclare`. Disallow variable redeclaration

- Source: eslint
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: no
- Reach: 222.4M weekly downloads of presets that enable it
- Trend: +31.5% last quarter
- Rank: #70 by reach, #1116 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `no-redeclare` | yes | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/no-redeclare) |
| Oxlint | `no-redeclare` | no | no | plugin `eslint`, category pedantic | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-redeclare.html) |
| Biome | `suspicious/noRedeclare` | yes | no | group suspicious, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/no-redeclare/) |

## Code examples

### Incorrect: the rule reports this

```js
var a = 3;
var a = 10;

class C {
    foo() {
        var b = 3;
        var b = 10;
    }

    static {
        var c = 3;
        var c = 10;
    }
}
```

### Correct: the rule accepts this

```js
var a = 3;
a = 10;

class C {
    foo() {
        var b = 3;
        b = 10;
    }

    static {
        var c = 3;
        c = 10;
    }
}
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "no-redeclare": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "no-redeclare": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "suspicious": {
        "noRedeclare": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [ESLint recommended](https://lintradar.dev/presets/eslint-recommended.md) | ESLint | `@eslint/js` | 64 | 178.8M | +25.9% |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Airbnb base](https://lintradar.dev/presets/airbnb-base.md) | ESLint | `eslint-config-airbnb-base` | 241 | 6.5M | +2.1% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [JavaScript Standard Style](https://lintradar.dev/presets/standard.md) | ESLint | `eslint-config-standard` | 161 | 3.1M | +12.9% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |

## Related rules

- [typescript/no-redeclare](https://lintradar.dev/rules/typescript/no-redeclare.md): Disallow variable redeclaration
- [eslint/prefer-const](https://lintradar.dev/rules/eslint/prefer-const.md): Require `const` declarations for variables that are never reassigned after declared
- [eslint/prefer-rest-params](https://lintradar.dev/rules/eslint/prefer-rest-params.md): Require rest parameters instead of `arguments`
- [eslint/no-prototype-builtins](https://lintradar.dev/rules/eslint/no-prototype-builtins.md): Disallow calling some `Object.prototype` methods directly on objects
- [eslint/no-useless-assignment](https://lintradar.dev/rules/eslint/no-useless-assignment.md): Disallow variable assignments when the value is not used
- [eslint/no-case-declarations](https://lintradar.dev/rules/eslint/no-case-declarations.md): Disallow lexical declarations in case clauses

---

Web page: https://lintradar.dev/rules/eslint/no-redeclare. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
