# promise/no-new-statics

> Disallow `new` on static `Promise` methods such as `Promise.all`

`Promise.all`, `Promise.resolve` and the other static methods are plain functions, not constructors. Calling one with `new` throws a `TypeError` at run time.

The rule covers `all`, `allSettled`, `any`, `race`, `reject`, `resolve`, `try` and `withResolvers`.

`--fix` removes the `new`.

{/* 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]
"promise/no-new-statics" = "error" # or "warn"
```

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

## Examples

Reported:

{/* bad */}
```js
async function loadPage() {
  return await new Promise.all([loadUser(), loadOrders()]);
}
```

Not reported:

{/* good */}
```js
async function loadPage() {
  return await Promise.all([loadUser(), loadOrders()]);
}
```
