Repository navigation
Expand file tree
/
Copy pathknip.jsonc
More file actions
143 lines (143 loc) · 4.97 KB
/
Copy pathknip.jsonc
File metadata and controls
143 lines (143 loc) · 4.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
{
"$schema": "https://unpkg.com/knip@6/schema.json",
"ignoreWorkspaces": [
"dev/*",
"perf/*",
"packages/@repo/test-exports",
"packages/@repo/test-dts-exports",
"packages/@repo/test-config",
"packages/@repo/tsconfig",
"packages/@repo/package.bundle",
"packages/sanity/fixtures/examples/*",
],
"ignoreExportsUsedInFile": {
"interface": true,
"type": true,
},
"workspaces": {
".": {
"project": ["*.{ts,mts,mjs}"],
"ignoreDependencies": [
// Knip does not parse scripts in actions/github-script
"dotenv",
// keeping it a dev dependency speeds up 'npx only-allow pnpm' in package.json's preinstall script
"only-allow",
// Used by the boundaries jsPlugin via `settings["import/resolver"]` in .oxlintrc.json,
// which knip can't trace (unlike jsPlugins, which it detects)
"eslint-import-resolver-typescript",
// Pins @babel/core 7 so Stryker's @babel/core 8 does not win the Sanity CLI's @rolldown/plugin-babel peer
"@babel/core",
],
"ignoreBinaries": [
// No root packages provide these binaries
"npm-check-updates",
"sanity-test",
"sanity-tsdoc",
// Knip doesn't understand `cd perf/studio && pnpm preview`
"preview",
// `pnpm dist-tag` invocations in tag-latest.yml / tag-stable.yml
"dist-tag",
// `pnpm deprecate` / `pnpm undeprecate` invocations in deprecate-version.yml
"deprecate",
"undeprecate",
// Installed system-wide via brew/uv/pipx, not npm
"zizmor",
],
},
// e2e is scanned so its heavy use of `@playwright/test` (catalog) is seen as
// used. The playwright plugin is disabled because the config reads required
// SANITY_E2E_* env vars at load time. Treat every file as an entry so the
// workspace's pre-existing unused files/exports (out of scope for this work)
// aren't reported, while dependency usage still is.
"e2e": {
"entry": ["**/*.{ts,tsx}"],
"project": ["**/*.{ts,tsx}"],
"playwright": false,
"ignoreDependencies": [
// CLI for local uploads (`pnpm --filter e2e exec chromatic --playwright`, see
// .agents/skills/sanity-visual-regression/REFERENCE.md); CI uploads through
// chromaui/action, which bundles its own copy. Neither use is traceable by knip.
"chromatic",
],
},
"packages/sanity": {
"entry": ["src/_exports/*.ts", "bin/sanity", "mock-browser-env-stub-loader.mjs"],
"project": [
"src/**/*.{ts,tsx}",
"!src/**/__test{,s}__", // These files might actually be safe to delete?
],
"ignoreBinaries": ["tzutil"],
"ignoreDependencies": [
// CLI for local uploads (`pnpm --filter sanity exec chromatic --vitest`, see
// .agents/skills/sanity-visual-regression/REFERENCE.md); CI uploads through
// chromaui/action, which bundles its own copy. Neither use is traceable by knip.
"chromatic",
// Optional peer of @sanity/tsdown-config that its `panda` option (tsdown.config.ts)
// loads with a dynamic import inside node_modules, which knip can't trace
"@sanity/pandacss-tsdown-plugin",
],
},
"packages/@repo/debug-proxy": {
"project": ["src/**/*.ts"],
"ignoreBinaries": ["mkcert"],
},
"packages/@sanity/schema": {
"entry": [
"src/_exports/*.ts",
// Knip can't trace `import * as types from './types'` in Schema.ts
"src/legacy/types/index.ts",
],
"project": ["src/**/*.ts"],
},
"packages/@sanity/mutator": {
"project": ["src/**/*.ts"],
},
"packages/@sanity/types": {
"project": ["src/**/*.ts"],
},
"packages/@sanity/diff": {
"project": ["src/**/*.ts"],
},
"packages/@sanity/vision": {
"project": ["src/**/*.{ts,tsx}"],
},
"packages/@sanity/util": {
"entry": ["src/_exports/*.ts"],
"project": ["src/**/*.ts"],
},
"packages/groq": {
"project": ["*.js", "*.cjs"],
},
"packages/@repo/bundle-manager": {
"project": ["src/**/*.ts"],
},
"packages/@repo/ailf": {
"entry": [".ailf/ailf.config.ts", ".ailf/tasks/*.reference.ts"],
"project": [".ailf/**/*.ts"],
"ignoreFiles": [".ailf/tasks/*.task.ts"],
},
"packages/@repo/release-notes": {
"project": ["src/**/*.ts"],
},
"packages/@repo/utils": {
"project": ["src/**/*.ts"],
},
"engine-confidence": {
"entry": ["scripts/*.ts", "stryker/*.{mjs,mts,ts}"],
"project": ["**/*.{ts,mts,mjs}"],
},
"packages/@repo/oxlint-plugin-i18n": {
// test/fixtures holds locale resource files the rule tests read from disk, not imports
"project": ["src/**/*.mjs", "test/*.mjs"],
},
"scripts": {
"entry": [
// Seems genuinely unused, but important?
"updateLicenses.ts",
// Hard to find
"listPublishedPackages.ts",
"symlinkDependencies.ts",
],
},
},
}