suspicious/useStaticResponseMethods
suspicious · since 2.0.0
Unsafe autofix
biome.json
{
"linter": {
"rules": {
"suspicious": {
"useStaticResponseMethods": "error"
}
}
}
}Use static Response methods instead of new Response() constructor when possible.
new Response(JSON.stringify({ value: 1 }));new Response(JSON.stringify({ value: 0 }), {
headers: {
'Content-Type': 'application/json',
}
})new Response(null, {
headers: {
location: 'https://example.com',
},
status: 302,
})// JSON.stringify() with a replacer function
new Response(JSON.stringify({ value: 0 }, () => {}))new Response(null, {
headers: {
location: 'https://example.com',
'x-foo': 'extra-header',
},
status: 302,
})new Response(null, {
headers: {
location: '/relative-url',
},
status: 302,
})Examples from the Biome documentation.
ESLint does not have this rule.
Oxlint does not have this rule.
suspicious/useStaticResponseMethods
suspicious · since 2.0.0
{
"linter": {
"rules": {
"suspicious": {
"useStaticResponseMethods": "error"
}
}
}
}Discard redundant terms from logical expressions.
Enforce the sorting of Tailwind CSS classes.
Require regex literals to be declared at the top level.
Require one executable GraphQL definition per file.