# useStaticResponseMethods

Rule `biome/useStaticResponseMethods`. Use static `Response` methods instead of `new Response()` constructor when possible.

- Source: biome
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 2.1M weekly downloads of presets that enable it
- Trend: +151.7% last quarter
- Rank: #1559 by reach, #63 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `suspicious/useStaticResponseMethods` | no | unsafe | group suspicious, since 2.0.0 | [docs](https://biomejs.dev/linter/rules/use-static-response-methods/) |

## Code examples

### Incorrect: the rule reports this

```js
new Response(JSON.stringify({ value: 1 }));
```

```js
new Response(JSON.stringify({ value: 0 }), {
    headers: {
        'Content-Type': 'application/json',
    }
})
```

```js
new Response(null, {
   headers: {
       location: 'https://example.com',
   },
   status: 302,
})
```

### Correct: the rule accepts this

```js
// JSON.stringify() with a replacer function
new Response(JSON.stringify({ value: 0 }, () => {}))
```

```js
new Response(null, {
   headers: {
       location: 'https://example.com',
       'x-foo': 'extra-header',
   },
   status: 302,
})
```

```js
new Response(null, {
   headers: {
       location: '/relative-url',
   },
   status: 302,
})
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "suspicious": {
        "useStaticResponseMethods": "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% |

## Related rules

- [biome/useSimplifiedLogicExpression](https://lintradar.dev/rules/biome/useSimplifiedLogicExpression.md): Discard redundant terms from logical expressions.
- [biome/useTailwindSortedClasses](https://lintradar.dev/rules/biome/useTailwindSortedClasses.md): Enforce the sorting of Tailwind CSS classes.
- [biome/useRequiredScripts](https://lintradar.dev/rules/biome/useRequiredScripts.md): Require configured scripts in `package.json`.
- [biome/useTopLevelRegex](https://lintradar.dev/rules/biome/useTopLevelRegex.md): Require regex literals to be declared at the top level.
- [biome/useNodeAssertStrict](https://lintradar.dev/rules/biome/useNodeAssertStrict.md): Prefer `node:assert/strict` over `node:assert`.
- [biome/useLoneExecutableDefinition](https://lintradar.dev/rules/biome/useLoneExecutableDefinition.md): Require one executable GraphQL definition per file.

---

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