# no-catch-shadow

Rule `eslint/no-catch-shadow`. Disallow `catch` clause parameters from shadowing variables in the outer scope

- Source: eslint
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: no
- Deprecated: yes
- Reach: 3.3M weekly downloads of presets that enable it
- Trend: +66.0% last quarter
- Rank: #1460 by reach, #455 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `no-catch-shadow` | no | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/no-catch-shadow) |
| Biome | `suspicious/noShadow` | no | no | group suspicious, since 2.0.0 | [docs](https://biomejs.dev/linter/rules/no-shadow/) |

## Code examples

### Incorrect: the rule reports this

```js
var err = "x";

try {
    throw "problem";
} catch (err) {

}

function error() {
    // ...
};

try {
    throw "problem";
} catch (error) {

}
```

### Correct: the rule accepts this

```js
var err = "x";

try {
    throw "problem";
} catch (e) {

}

function error() {
    // ...
};

try {
    throw "problem";
} catch (e) {

}
```

Examples from the ESLint documentation.

## Enable it

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

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

### Biome: `biome.json`

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

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [React Native](https://lintradar.dev/presets/react-native.md) | ESLint | `@react-native/eslint-config` | 79 | 1.2M | +5.8% |

## Related rules

- [eslint/no-div-regex](https://lintradar.dev/rules/eslint/no-div-regex.md): Disallow equal signs explicitly at the beginning of regular expressions
- [eslint/no-object-constructor](https://lintradar.dev/rules/eslint/no-object-constructor.md): Disallow calls to the `Object` constructor without an argument
- [eslint/max-nested-callbacks](https://lintradar.dev/rules/eslint/max-nested-callbacks.md): Enforce a maximum depth that callbacks can be nested
- [eslint/complexity](https://lintradar.dev/rules/eslint/complexity.md): Enforce a maximum cyclomatic complexity allowed in a program
- [eslint/require-unicode-regexp](https://lintradar.dev/rules/eslint/require-unicode-regexp.md): Enforce the use of `u` or `v` flag on regular expressions
- [eslint/prefer-object-has-own](https://lintradar.dev/rules/eslint/prefer-object-has-own.md): Disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`

---

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