8000 feat: Add scanning for dead code with `knip` (#35072) · CodersSampling/supabase@d39671f · GitHub
[go: up one dir, main page]

Skip to content

Commit d39671f

Browse files
authored
feat: Add scanning for dead code with knip (supabase#35072)
* Add knip as dev dependency. * Add config and script for knip. * Add additional ignores to the file list. * Remove knip as a dependency, download and run it :).
1 parent 08e5abc commit d39671f

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

knip.jsonc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://unpkg.com/knip@5/schema-jsonc.json",
3+
"exclude": ["types", "exports"],
4+
"ignore": [
5+
"examples/**",
6+
"**/*.mdx",
7+
// skip supabase functions
8+
"supabase/functions/**",
9+
"**/*.test.ts",
10+
// ignore studio public folder
11+
"apps/studio/public/**",
12+
// ignore studio components, they're dynamically imported
13+
"apps/studio/components/interfaces/Connect/content/**",
14+
],
15+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"perf:kong": "ab -t 5 -c 20 -T application/json http://localhost:8000/",
3434
"perf:meta": "ab -t 5 -c 20 -T application/json http://localhost:5555/tables",
3535
"generate:types": "supabase gen types typescript --local > ./supabase/functions/common/database-types.ts",
36-
"api:codegen": "cd packages/api-types && pnpm run codegen"
36+
"api:codegen": "cd packages/api-types && pnpm run codegen",
37+
"knip": "pnpx knip@~5.50.0"
3738
},
3839
"devDependencies": {
3940
"@types/node": "catalog:",

pnpm-lock.yaml

Lines changed: 1 addition & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0