# no-redeclare

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

- Source: typescript
- Technologies: TypeScript
- Kind: suspicious
- Needs type information: no
- Autofix: no
- Reach: 6.6M weekly downloads of presets that enable it
- Trend: +4.3% last quarter
- Rank: #1158 by reach, #1539 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@typescript-eslint/no-redeclare` | no | no | package `@typescript-eslint/eslint-plugin` | [docs](https://typescript-eslint.io/rules/no-redeclare) |
| Biome | `suspicious/noRedeclare` | yes | no | group suspicious, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/no-redeclare/) |

## Code examples

### Correct: the rule accepts this

```ts
interface A {
  prop1: 1;
}
interface A {
  prop2: 2;
}

namespace Foo {
  export const a = 1;
}
namespace Foo {
  export const b = 2;
}

class Bar {}
namespace Bar {}

function Baz() {}
namespace Baz {}
```

```ts
type something = string;
// eslint-disable-next-line @typescript-eslint/no-redeclare -- intentionally naming the variable the same as the type
const something = 2;
```

Examples from the ESLint documentation.

## Enable it

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

```js
import tseslint from "typescript-eslint";

export default [
  {
    plugins: { "@typescript-eslint": tseslint.plugin },
    rules: {
      "@typescript-eslint/no-redeclare": "error",
    },
  },
];
```

### Biome: `biome.json`

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

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Create React App](https://lintradar.dev/presets/react-app.md) | ESLint | `eslint-config-react-app` | 109 | 4.1M | +4.3% |
| [Airbnb TypeScript](https://lintradar.dev/presets/airbnb-typescript.md) | ESLint | `eslint-config-airbnb-typescript` | 19 | 1.8M | +1.2% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |
| [neostandard](https://lintradar.dev/presets/neostandard.md) | ESLint | `neostandard` | 95 | 317.6K | +50.2% |

## Related rules

- [eslint/no-redeclare](https://lintradar.dev/rules/eslint/no-redeclare.md): Disallow variable redeclaration
- [typescript/no-use-before-define](https://lintradar.dev/rules/typescript/no-use-before-define.md): Disallow the use of variables before they are defined
- [typescript/no-import-type-side-effects](https://lintradar.dev/rules/typescript/no-import-type-side-effects.md): Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers
- [typescript/dot-notation](https://lintradar.dev/rules/typescript/dot-notation.md): Enforce dot notation whenever possible
- [typescript/no-dupe-class-members](https://lintradar.dev/rules/typescript/no-dupe-class-members.md): Disallow duplicate class members
- [typescript/no-shadow](https://lintradar.dev/rules/typescript/no-shadow.md): Disallow variable declarations from shadowing variables declared in the outer scope

---

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