# bun/no-redundant-catch-type

> Disallow `: unknown` on the variable of a `catch` clause

With `strict` or `useUnknownInCatchVariables` in `tsconfig.json`, a `catch` clause's variable is already `unknown`. Writing `: unknown` adds nothing.

`--fix` removes the annotation.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

Off by default. To turn it on:

```toml bunfig.toml
[lint.rules]
"bun/no-redundant-catch-type" = "error" # or "warn"
```

{/* End of the generated section. */}

## Examples

Reported:

{/* bad */}
```ts
try {
  await save(draft);
} catch (error: unknown) {
  report(error);
}
```

Not reported:

{/* good */}
```ts
try {
  await save(draft);
} catch (error) {
  report(error);
}
```

## When not to use it

The rule doesn't read your `tsconfig.json`. Without `strict` or `useUnknownInCatchVariables`, the variable is `any`, and `: unknown` is what makes it safe. Leave the rule off in a project like that.
