# missing-throw

Rule `oxc/missing-throw`. Checks whether the `throw` keyword is missing in front of a `new` expression.

- Source: oxc
- Technologies: JavaScript
- Kind: correctness
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 81.4M weekly downloads of presets that enable it
- Trend: +150.3% last quarter
- Rank: #222 by reach, #75 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Oxlint | `oxc/missing-throw` | yes | safe | plugin `oxc`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/oxc/missing-throw.html) |
| Biome | `nursery/noMissingThrow` | yes | unsafe | group nursery, since 2.6.5 | [docs](https://biomejs.dev/linter/rules/no-missing-throw/) |

## Code examples

### Incorrect: the rule reports this

```js
function foo() { throw Error() }
const foo = () => { new Error() }
```

### Correct: the rule accepts this

```js
function foo() { throw new Error() }
const foo = () => { throw new Error() }
```

Examples from the Oxlint documentation.

## Enable it

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "oxc/missing-throw": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noMissingThrow": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Oxlint default](https://lintradar.dev/presets/oxlint-default.md) | Oxlint | `oxlint` | 111 | 50.8M | +183.6% |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [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

- [oxc/erasing-op](https://lintradar.dev/rules/oxc/erasing-op.md): Checks for erasing operations, e.g., `x * 0`.
- [oxc/number-arg-out-of-range](https://lintradar.dev/rules/oxc/number-arg-out-of-range.md): Checks whether the radix or precision arguments of number-related functions exceed the limit.
- [oxc/const-comparisons](https://lintradar.dev/rules/oxc/const-comparisons.md): Checks for redundant or logically impossible comparisons. This includes: - Ineffective double comparisons against constants. - Impossible comparisons involving constants. - Redundant comparisons where both operands are the same (e.g., a < a).
- [oxc/uninvoked-array-callback](https://lintradar.dev/rules/oxc/uninvoked-array-callback.md): This rule applies when an Array function has a callback argument used for an array with empty slots.
- [oxc/bad-replace-all-arg](https://lintradar.dev/rules/oxc/bad-replace-all-arg.md): This rule warns when the `replaceAll` method is called with a regular expression that does not have the global flag (g).
- [oxc/bad-object-literal-comparison](https://lintradar.dev/rules/oxc/bad-object-literal-comparison.md): Checks for comparisons between object and array literals.

---

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