-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: introduce Knip as dead-code removal tool (#6368)
* Add knip with inital config * Rename vite.config.js → vite.config.js (`__dirname` not in ESM scope) * chore: upgrade to knip v3 * chore(knip): remove duplicate exports * chore(knip): remove unused types from query devtools * chore(knip): do not export unused types * chore(knip): run knip in ci * chore(knip): ignore certain .d.ts files * chore(knip): remove unused file * chore(knip): use devtools in next integration so the dependency doesn't show up as unused * chore(knip): remove unused dependencies * chore(knip): remove unused exports * chore(knip): add unlisted dependencies * chore(knip): remove unnecessary scope-manager dependency * Update knip to 3.3.0 * Update knip to 3.3.1 * chore: ignore custom deps, remove unneeded file * chore: remove unused util * chore: remove esbuild dep as it's not directly used * chore: bump tsup to match esbuild types with the plugin * chore: remove unused peer deps * chore: remove unneeded deps --------- Co-authored-by: Dominik Dorfmeister <[email protected]> Co-authored-by: Damian Osipiuk <[email protected]>
- Loading branch information
1 parent
ac92fc9
commit 5d29f8f
Showing
33 changed files
with
849 additions
and
813 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider> | ||
<QueryClientProvider client={queryClient}> | ||
{children} | ||
<ReactQueryDevtools /> | ||
</QueryClientProvider> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = /<script\b[^>]*>([\s\S]*?)<\/script>/gm | ||
|
||
export default { | ||
$schema: 'https://unpkg.com/knip@2/schema.json', | ||
ignoreWorkspaces: ['examples/**'], | ||
ignore: ['**/react-app-env.d.ts', '**/vite-env.d.ts'], | ||
workspaces: { | ||
'packages/codemods': { | ||
entry: ['src/v4/*.js', 'src/v5/*/*.js'], | ||
ignore: ['**/__testfixtures__/**'], | ||
}, | ||
'packages/vue-query': { | ||
ignore: ['**/__mocks__/**'], | ||
ignoreDependencies: ['vue2', 'vue2.7'], | ||
}, | ||
}, | ||
compilers: { | ||
svelte: (text: string) => [...svelteCompiler(text)].join('\n'), | ||
vue: (text) => { | ||
const scripts = [] | ||
let match | ||
while ((match = vueCompiler.exec(text))) scripts.push(match[1]) | ||
return scripts.join(';') | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.