feat: Add scanning for dead code with knip (#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 :).
This commit is contained in:
Ivan Vasilov authored and GitHub committed 2025-04-16 17:07:35 +02:00
1 parent 08e5abc64a
commit d39671f1c9
3 files changed
+18 -9

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/knip@5/schema-jsonc.json",
"exclude": ["types", "exports"],
"ignore": [
"examples/**",
"**/*.mdx",
// skip supabase functions
"supabase/functions/**",
"**/*.test.ts",
// ignore studio public folder
"apps/studio/public/**",
// ignore studio components, they're dynamically imported
"apps/studio/components/interfaces/Connect/content/**",
],
}
+2 -1
View File
@@ -33,7 +33,8 @@
"perf:kong": "ab -t 5 -c 20 -T application/json http://localhost:8000/",
"perf:meta": "ab -t 5 -c 20 -T application/json http://localhost:5555/tables",
"generate:types": "supabase gen types typescript --local > ./supabase/functions/common/database-types.ts",
"api:codegen": "cd packages/api-types && pnpm run codegen"
"api:codegen": "cd packages/api-types && pnpm run codegen",
"knip": "pnpx knip@~5.50.0"
},
"devDependencies": {
"@types/node": "catalog:",
+1 -8
View File
@@ -8769,9 +8769,6 @@ packages:
fastify@4.29.0:
resolution: {integrity: sha512-MaaUHUGcCgC8fXQDsDtioaCcag1fmPJ9j64vAKunqZF4aSub040ZGi/ag8NGE2714yREPOKZuHCfpPzuUD3UQQ==}
fastq@1.15.0:
resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==}
fastq@1.18.0:
resolution: {integrity: sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==}
@@ -16437,7 +16434,7 @@ snapshots:
'@nodelib/fs.walk@1.2.8':
dependencies:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.15.0
fastq: 1.18.0
'@npmcli/agent@2.2.2(supports-color@8.1.1)':
dependencies:
@@ -22969,10 +22966,6 @@ snapshots:
semver: 7.6.3
toad-cache: 3.7.0
fastq@1.15.0:
dependencies:
reusify: 1.0.4
fastq@1.18.0:
dependencies:
reusify: 1.0.4