Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 781 Bytes

File metadata and controls

22 lines (14 loc) · 781 Bytes

prefer-response-static-json

📝 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);