-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathknip.jsonc
More file actions
61 lines (61 loc) · 2.6 KB
/
Copy pathknip.jsonc
File metadata and controls
61 lines (61 loc) · 2.6 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
{
"$schema": "https://unpkg.com/knip@6/schema-jsonc.json",
// builder.ts (and friends) export reference-identity singletons (`_var`,
// `failInvalidType`, `noopOperation`, …) compared by `===` across modules.
// As long as they're imported somewhere they're "used"; this only stops
// same-file-only exports from being reported, never cross-module ones.
"ignoreExportsUsedInFile": true,
// Intentional two-name exports (e.g. `schema`/`schemaFactory`,
// `SuryError`/`errorClass`): the codebase deliberately re-exports one value
// under a public and an internal name, so don't flag them as duplicates.
"rules": {
"duplicates": "off"
},
// tsx runs the spec CLI; dune builds the OCaml ppx. Both are invoked from
// scripts/CI, not declared as npm bin deps.
"ignoreBinaries": ["tsx", "dune"],
"workspaces": {
"packages/sury": {
"entry": [
// Public JS/TS API + `$`-prefixed exports consumed by S.res (ReScript) at
// runtime, not via TS imports — anchor them so they aren't flagged.
"src/entry.ts",
// Invoked through package.json scripts (build:entry / build).
"scripts/pack.ts",
"tests/**/*_test.ts"
],
"project": ["src/**/*.ts", "scripts/**/*.ts", "tests/**/*.ts"],
"vitest": {
"config": ["vitest.config.mjs"],
"entry": ["tests/**/*_test.ts"]
},
// @rescript/darwin-arm64 is a platform binary pulled in per-OS; the
// rescript runtime is imported by the checked-in compiled S.res.mjs. zod
// is imported only via a string the spec harness's type probe generates
// at runtime (packages/spec/introspect.ts), so static analysis can't see it.
"ignoreDependencies": ["@rescript/darwin-arm64", "@rescript/runtime", "zod"]
},
"packages/spec": {
// benchChild.ts is esbuilt to .bench-cache and spawned as a subprocess,
// and perfComment.ts is run by CI to format the PR comment — neither is
// ever imported, so both need anchoring.
"entry": ["cli.ts", "benchChild.ts", "perfComment.ts"],
"project": ["**/*.ts"]
},
"packages/json-schema-test-suite": {
"entry": ["cli.ts"],
"project": ["**/*.ts"]
},
"packages/e2e": {
"entry": ["src/**/*.bench.ts", "vitest.config.mjs"],
"project": ["src/**/*.ts"],
"vitest": {
"config": ["vitest.config.mjs"]
},
// genType-emitted artifacts; sury-ppx is a ReScript ppx binary wired via
// rescript.json, not a TS import; rescript runtime as above.
"ignore": ["src/genType/**"],
"ignoreDependencies": ["sury-ppx", "@rescript/runtime"]
}
}
}