Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ ruleTester.run('stable-query-client', rule, {
}
`,
},
{
name: 'QueryClient is not flagged in an async react-query server component',
code: normalizeIndent`
import { QueryClient } from "@tanstack/react-query";

async function ServerComponent() {
const queryClient = new QueryClient();
return;
}
`,
},
],
invalid: [
{
Expand Down Expand Up @@ -188,5 +199,18 @@ ruleTester.run('stable-query-client', rule, {
`,
errors: [{ messageId: 'unstable' }],
},
{
name: 'QueryClient with destructuring pattern reports error without autofix',
code: normalizeIndent`
import { QueryClient } from "@tanstack/react-query";

function Component() {
const { defaultOptions } = new QueryClient();
return;
}
`,
output: null,
errors: [{ messageId: 'unstable' }],
},
],
})
Loading