prefer-response-static-json
March 27, 2026 ยท View on GitHub
๐ Prefer Response.json() over new Response(JSON.stringify()).
๐ผ This rule is enabled in the following configs: โ
recommended, โ๏ธ unopinionated.
๐ง This rule is automatically fixable by the --fix CLI option.
Prefer using Response.json() when possible.
Examples
// โ
const response = new Response(JSON.stringify(data));
// โ
const response = Response.json(data);