diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index 9a571f9c67..e36ac20ce0 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -100,3 +100,24 @@ jobs:
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
- name: Run prettier
run: pnpm run test:format
+ knip:
+ name: Knip
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v2
+ with:
+ version: 8
+ - name: Setup Node
+ uses: actions/setup-node@v3
+ with:
+ node-version-file: .nvmrc
+ cache: pnpm
+ cache-dependency-path: pnpm-lock.yaml
+ - name: Install dependencies
+ run: pnpm --filter "./packages/**" --filter query --prefer-offline install
+ - name: Run Knip
+ run: pnpm knip
diff --git a/integrations/react-cra4/src/App.jsx b/integrations/react-cra4/src/App.jsx
index 05f63e0389..9541afa9a5 100644
--- a/integrations/react-cra4/src/App.jsx
+++ b/integrations/react-cra4/src/App.jsx
@@ -1,6 +1,6 @@
import { useQuery } from '@tanstack/react-query'
-export const App = () => {
+const App = () => {
const query = useQuery({
queryKey: ['test'],
queryFn: async () => {
diff --git a/integrations/react-cra5/src/App.jsx b/integrations/react-cra5/src/App.jsx
index 05f63e0389..9541afa9a5 100644
--- a/integrations/react-cra5/src/App.jsx
+++ b/integrations/react-cra5/src/App.jsx
@@ -1,6 +1,6 @@
import { useQuery } from '@tanstack/react-query'
-export const App = () => {
+const App = () => {
const query = useQuery({
queryKey: ['test'],
queryFn: async () => {
diff --git a/integrations/react-next/app/providers.tsx b/integrations/react-next/app/providers.tsx
index 147bc3bf07..4e24c0c97b 100644
--- a/integrations/react-next/app/providers.tsx
+++ b/integrations/react-next/app/providers.tsx
@@ -1,11 +1,15 @@
'use client'
import * as React from 'react'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
+import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
export default function Providers({ children }: { children: React.ReactNode }) {
const [queryClient] = React.useState(() => new QueryClient())
return (
- {children}
+
+ {children}
+
+
)
}
diff --git a/integrations/react-vite4/src/App.jsx b/integrations/react-vite4/src/App.jsx
index 05f63e0389..9541afa9a5 100644
--- a/integrations/react-vite4/src/App.jsx
+++ b/integrations/react-vite4/src/App.jsx
@@ -1,6 +1,6 @@
import { useQuery } from '@tanstack/react-query'
-export const App = () => {
+const App = () => {
const query = useQuery({
queryKey: ['test'],
queryFn: async () => {
diff --git a/integrations/react-vite5/src/App.jsx b/integrations/react-vite5/src/App.jsx
index 05f63e0389..9541afa9a5 100644
--- a/integrations/react-vite5/src/App.jsx
+++ b/integrations/react-vite5/src/App.jsx
@@ -1,6 +1,6 @@
import { useQuery } from '@tanstack/react-query'
-export const App = () => {
+const App = () => {
const query = useQuery({
queryKey: ['test'],
queryFn: async () => {
diff --git a/integrations/solid-vite/src/App.jsx b/integrations/solid-vite/src/App.jsx
index 48b20fe733..69b43f0950 100644
--- a/integrations/solid-vite/src/App.jsx
+++ b/integrations/solid-vite/src/App.jsx
@@ -1,7 +1,7 @@
import { Match, Switch } from 'solid-js'
import { createQuery } from '@tanstack/solid-query'
-export const App = () => {
+const App = () => {
const query = createQuery(() => ({
queryKey: ['test'],
queryFn: async () => {
diff --git a/knip.ts b/knip.ts
new file mode 100644
index 0000000000..272f2c7d31
--- /dev/null
+++ b/knip.ts
@@ -0,0 +1,28 @@
+// These aren't actual compilers, but performant & avoids root dependencies
+const svelteCompiler = (text: string) => text.matchAll(/import[^]*?'.*?'\n/gs)
+const vueCompiler = /