knip 6.14.2 → 6.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CacheConsultant.d.ts +1 -0
- package/dist/CacheConsultant.js +2 -0
- package/dist/ConfigurationChief.d.ts +32 -0
- package/dist/ConfigurationChief.js +9 -11
- package/dist/DependencyDeputy.d.ts +0 -4
- package/dist/DependencyDeputy.js +4 -16
- package/dist/IssueCollector.d.ts +1 -0
- package/dist/IssueCollector.js +10 -20
- package/dist/IssueFixer.js +10 -15
- package/dist/ProjectPrincipal.d.ts +2 -3
- package/dist/ProjectPrincipal.js +13 -21
- package/dist/WorkspaceWorker.js +6 -1
- package/dist/binaries/fallback.js +1 -1
- package/dist/binaries/plugins.js +1 -1
- package/dist/binaries/resolvers/bun.js +1 -1
- package/dist/binaries/resolvers/bunx.js +1 -1
- package/dist/binaries/resolvers/npm.js +1 -1
- package/dist/binaries/resolvers/npx.js +1 -1
- package/dist/binaries/resolvers/pnpm.js +1 -1
- package/dist/binaries/resolvers/pnpx.js +1 -1
- package/dist/binaries/resolvers/yarn.js +1 -1
- package/dist/binaries/util.d.ts +1 -2
- package/dist/binaries/util.js +1 -1
- package/dist/cli.js +3 -1
- package/dist/compilers/compilers.d.ts +3 -0
- package/dist/compilers/compilers.js +9 -13
- package/dist/compilers/index.d.ts +52 -0
- package/dist/compilers/scss.js +9 -3
- package/dist/graph/analyze.js +15 -8
- package/dist/graph/build.js +3 -5
- package/dist/manifest/index.js +11 -14
- package/dist/plugins/_custom-elements/custom-element-visitor.d.ts +7 -0
- package/dist/plugins/_custom-elements/custom-element-visitor.js +106 -0
- package/dist/plugins/bun/index.js +1 -1
- package/dist/plugins/catalyst/index.d.ts +3 -0
- package/dist/plugins/catalyst/index.js +16 -0
- package/dist/plugins/execa/visitors/execa.js +4 -17
- package/dist/plugins/fast/index.d.ts +3 -0
- package/dist/plugins/fast/index.js +16 -0
- package/dist/plugins/index.d.ts +5 -0
- package/dist/plugins/index.js +10 -0
- package/dist/plugins/lit/index.d.ts +3 -0
- package/dist/plugins/lit/index.js +25 -0
- package/dist/plugins/nano-spawn/index.d.ts +3 -0
- package/dist/plugins/nano-spawn/index.js +15 -0
- package/dist/plugins/nano-spawn/visitors/nano-spawn.d.ts +2 -0
- package/dist/plugins/nano-spawn/visitors/nano-spawn.js +12 -0
- package/dist/plugins/orval/index.d.ts +3 -0
- package/dist/plugins/orval/index.js +16 -0
- package/dist/plugins/orval/resolveFromAST.d.ts +2 -0
- package/dist/plugins/orval/resolveFromAST.js +11 -0
- package/dist/plugins/orval/types.d.ts +9 -0
- package/dist/plugins/orval/types.js +1 -0
- package/dist/plugins/relay/index.js +1 -1
- package/dist/plugins/stencil/index.js +17 -1
- package/dist/plugins/sveltejs-package/helpers.js +1 -1
- package/dist/plugins/vite/helpers.js +23 -6
- package/dist/plugins/webdriver-io/index.js +3 -3
- package/dist/plugins/webdriver-io/types.d.ts +5 -1
- package/dist/reporters/github-actions.d.ts +1 -1
- package/dist/reporters/github-actions.js +19 -1
- package/dist/reporters/index.d.ts +1 -1
- package/dist/reporters/symbols.js +2 -1
- package/dist/reporters/trace.d.ts +3 -1
- package/dist/reporters/trace.js +48 -16
- package/dist/reporters/util/configuration-hints.d.ts +1 -1
- package/dist/reporters/util/configuration-hints.js +3 -2
- package/dist/schema/configuration.d.ts +83 -1
- package/dist/schema/configuration.js +2 -0
- package/dist/schema/plugins.d.ts +25 -0
- package/dist/schema/plugins.js +5 -0
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +5 -0
- package/dist/types/args.d.ts +1 -1
- package/dist/types/config.d.ts +2 -0
- package/dist/types/issues.d.ts +1 -0
- package/dist/types/module-graph.d.ts +1 -0
- package/dist/types/project.d.ts +0 -1
- package/dist/typescript/ast-helpers.js +21 -20
- package/dist/typescript/ast-nodes.d.ts +1 -0
- package/dist/typescript/ast-nodes.js +19 -0
- package/dist/typescript/get-imports-and-exports.js +18 -2
- package/dist/typescript/resolve-module-names.d.ts +6 -2
- package/dist/typescript/resolve-module-names.js +20 -29
- package/dist/typescript/visitors/calls.d.ts +3 -2
- package/dist/typescript/visitors/calls.js +88 -16
- package/dist/typescript/visitors/exports.js +12 -0
- package/dist/typescript/visitors/walk.d.ts +7 -0
- package/dist/typescript/visitors/walk.js +43 -1
- package/dist/util/Performance.d.ts +13 -28
- package/dist/util/Performance.js +41 -72
- package/dist/util/cli-arguments.d.ts +3 -1
- package/dist/util/cli-arguments.js +4 -0
- package/dist/util/create-options.d.ts +53 -0
- package/dist/util/create-options.js +2 -1
- package/dist/util/disk-cache.d.ts +1 -0
- package/dist/util/disk-cache.js +8 -0
- package/dist/util/gitignore-cache.js +5 -11
- package/dist/util/glob-cache.js +2 -8
- package/dist/util/glob-core.js +4 -7
- package/dist/util/jiti.js +1 -0
- package/dist/util/load-tsconfig.js +0 -3
- package/dist/util/parse-args.d.ts +14 -0
- package/dist/util/parse-args.js +112 -0
- package/dist/util/trace.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -6
- package/schema.json +73 -43
- package/dist/util/math.d.ts +0 -6
- package/dist/util/math.js +0 -11
package/dist/util/trace.js
CHANGED
|
@@ -24,7 +24,7 @@ export const formatTrace = (node, toRelative, isReferenced, memberStatuses) => {
|
|
|
24
24
|
const childPrefix = isLast ? ' ' : '│ ';
|
|
25
25
|
const entryMarker = child.isEntry ? dim(' ⎆') : '';
|
|
26
26
|
const isLeaf = child.children.length === 0;
|
|
27
|
-
const leafMarker = isLeaf
|
|
27
|
+
const leafMarker = isLeaf ? (isReferenced ? ok(' ✓') : fail(' ✗')) : '';
|
|
28
28
|
lines.push(`${dim(prefix)}${dim(connector)}${file(toRelative(child.filePath))}${dim(':')}${formatVia(child)}${entryMarker}${leafMarker}`);
|
|
29
29
|
if (child.refs.length > 0) {
|
|
30
30
|
const refsPrefix = isLeaf ? ' ' : '│';
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.
|
|
1
|
+
export declare const version = "6.16.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '6.
|
|
1
|
+
export const version = '6.16.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knip",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.16.0",
|
|
4
4
|
"description": "Find and fix unused dependencies, exports and files in your TypeScript and JavaScript projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"analysis",
|
|
@@ -81,9 +81,8 @@
|
|
|
81
81
|
"formatly": "^0.3.0",
|
|
82
82
|
"get-tsconfig": "4.14.0",
|
|
83
83
|
"jiti": "^2.7.0",
|
|
84
|
-
"
|
|
85
|
-
"oxc-
|
|
86
|
-
"oxc-resolver": "^11.19.1",
|
|
84
|
+
"oxc-parser": "^0.133.0",
|
|
85
|
+
"oxc-resolver": "^11.20.0",
|
|
87
86
|
"picomatch": "^4.0.4",
|
|
88
87
|
"smol-toml": "^1.6.1",
|
|
89
88
|
"strip-json-comments": "5.0.3",
|
|
@@ -95,11 +94,9 @@
|
|
|
95
94
|
"devDependencies": {
|
|
96
95
|
"@jest/types": "^29.6.3",
|
|
97
96
|
"@types/bun": "^1.3.3",
|
|
98
|
-
"@types/minimist": "^1.2.5",
|
|
99
97
|
"@types/picomatch": "^4.0.1",
|
|
100
98
|
"@types/webpack": "^5.28.5",
|
|
101
99
|
"@typescript/native-preview": "7.0.0-dev.20260512.1",
|
|
102
|
-
"@wdio/types": "^9.20.0",
|
|
103
100
|
"codeclimate-types": "^0.3.1",
|
|
104
101
|
"prettier": "^3.8.1",
|
|
105
102
|
"tsx": "^4.21.0"
|
package/schema.json
CHANGED
|
@@ -52,49 +52,7 @@
|
|
|
52
52
|
"$ref": "#/definitions/issueTypes"
|
|
53
53
|
},
|
|
54
54
|
"ignoreExportsUsedInFile": {
|
|
55
|
-
"
|
|
56
|
-
"examples": [
|
|
57
|
-
{
|
|
58
|
-
"ignoreExportsUsedInFile": true
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"ignoreExportsUsedInFile": {
|
|
62
|
-
"interface": true,
|
|
63
|
-
"type": true
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
],
|
|
67
|
-
"anyOf": [
|
|
68
|
-
{
|
|
69
|
-
"type": "boolean"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"type": "object",
|
|
73
|
-
"properties": {
|
|
74
|
-
"class": {
|
|
75
|
-
"type": "boolean"
|
|
76
|
-
},
|
|
77
|
-
"enum": {
|
|
78
|
-
"type": "boolean"
|
|
79
|
-
},
|
|
80
|
-
"function": {
|
|
81
|
-
"type": "boolean"
|
|
82
|
-
},
|
|
83
|
-
"interface": {
|
|
84
|
-
"type": "boolean"
|
|
85
|
-
},
|
|
86
|
-
"member": {
|
|
87
|
-
"type": "boolean"
|
|
88
|
-
},
|
|
89
|
-
"type": {
|
|
90
|
-
"type": "boolean"
|
|
91
|
-
},
|
|
92
|
-
"variable": {
|
|
93
|
-
"type": "boolean"
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
]
|
|
55
|
+
"$ref": "#/definitions/ignoreExportsUsedInFile"
|
|
98
56
|
},
|
|
99
57
|
"ignoreIssues": {
|
|
100
58
|
"title": " Ignore specific issue types for specific file patterns",
|
|
@@ -185,6 +143,10 @@
|
|
|
185
143
|
"treatConfigHintsAsErrors": {
|
|
186
144
|
"title": "Exit with non-zero code (1) if there are any configuration hints",
|
|
187
145
|
"type": "boolean"
|
|
146
|
+
},
|
|
147
|
+
"treatTagHintsAsErrors": {
|
|
148
|
+
"title": "Exit with non-zero code (1) if there are any tag hints",
|
|
149
|
+
"type": "boolean"
|
|
188
150
|
}
|
|
189
151
|
},
|
|
190
152
|
"unevaluatedProperties": false,
|
|
@@ -220,6 +182,51 @@
|
|
|
220
182
|
"title": "Include entry files when reporting unused exports",
|
|
221
183
|
"type": "boolean"
|
|
222
184
|
},
|
|
185
|
+
"ignoreExportsUsedInFile": {
|
|
186
|
+
"title": "Ignore exports used in file",
|
|
187
|
+
"examples": [
|
|
188
|
+
{
|
|
189
|
+
"ignoreExportsUsedInFile": true
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"ignoreExportsUsedInFile": {
|
|
193
|
+
"interface": true,
|
|
194
|
+
"type": true
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"anyOf": [
|
|
199
|
+
{
|
|
200
|
+
"type": "boolean"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"type": "object",
|
|
204
|
+
"properties": {
|
|
205
|
+
"class": {
|
|
206
|
+
"type": "boolean"
|
|
207
|
+
},
|
|
208
|
+
"enum": {
|
|
209
|
+
"type": "boolean"
|
|
210
|
+
},
|
|
211
|
+
"function": {
|
|
212
|
+
"type": "boolean"
|
|
213
|
+
},
|
|
214
|
+
"interface": {
|
|
215
|
+
"type": "boolean"
|
|
216
|
+
},
|
|
217
|
+
"member": {
|
|
218
|
+
"type": "boolean"
|
|
219
|
+
},
|
|
220
|
+
"type": {
|
|
221
|
+
"type": "boolean"
|
|
222
|
+
},
|
|
223
|
+
"variable": {
|
|
224
|
+
"type": "boolean"
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
},
|
|
223
230
|
"ignoreMembers": {
|
|
224
231
|
"title": "Enum and namespace members to exclude from the report (regex allowed)",
|
|
225
232
|
"examples": ["render", "on.*"],
|
|
@@ -306,6 +313,9 @@
|
|
|
306
313
|
"ignoreUnresolved": {
|
|
307
314
|
"$ref": "#/definitions/ignoreUnresolved"
|
|
308
315
|
},
|
|
316
|
+
"ignoreExportsUsedInFile": {
|
|
317
|
+
"$ref": "#/definitions/ignoreExportsUsedInFile"
|
|
318
|
+
},
|
|
309
319
|
"includeEntryExports": {
|
|
310
320
|
"$ref": "#/definitions/includeEntryExports"
|
|
311
321
|
}
|
|
@@ -384,6 +394,10 @@
|
|
|
384
394
|
"title": "Capacitor plugin configuration (https://knip.dev/reference/plugins/capacitor)",
|
|
385
395
|
"$ref": "#/definitions/plugin"
|
|
386
396
|
},
|
|
397
|
+
"catalyst": {
|
|
398
|
+
"title": "catalyst plugin configuration (https://knip.dev/reference/plugins/catalyst)",
|
|
399
|
+
"$ref": "#/definitions/plugin"
|
|
400
|
+
},
|
|
387
401
|
"changelogen": {
|
|
388
402
|
"title": "changelogen plugin configuration (https://knip.dev/reference/plugins/changelogen)",
|
|
389
403
|
"$ref": "#/definitions/plugin"
|
|
@@ -464,6 +478,10 @@
|
|
|
464
478
|
"title": "expressive-code plugin configuration (https://knip.dev/reference/plugins/expressive-code)",
|
|
465
479
|
"$ref": "#/definitions/plugin"
|
|
466
480
|
},
|
|
481
|
+
"fast": {
|
|
482
|
+
"title": "fast plugin configuration (https://knip.dev/reference/plugins/fast)",
|
|
483
|
+
"$ref": "#/definitions/plugin"
|
|
484
|
+
},
|
|
467
485
|
"gatsby": {
|
|
468
486
|
"title": "Gatsby plugin configuration (https://knip.dev/reference/plugins/gatsby)",
|
|
469
487
|
"$ref": "#/definitions/plugin"
|
|
@@ -520,6 +538,10 @@
|
|
|
520
538
|
"title": "linthtml plugin configuration (https://knip.dev/reference/plugins/linthtml)",
|
|
521
539
|
"$ref": "#/definitions/plugin"
|
|
522
540
|
},
|
|
541
|
+
"lit": {
|
|
542
|
+
"title": "lit plugin configuration (https://knip.dev/reference/plugins/lit)",
|
|
543
|
+
"$ref": "#/definitions/plugin"
|
|
544
|
+
},
|
|
523
545
|
"lockfile-lint": {
|
|
524
546
|
"title": "lockfile-lint plugin configuration (https://knip.dev/reference/plugins/lockfile-lint)",
|
|
525
547
|
"$ref": "#/definitions/plugin"
|
|
@@ -556,6 +578,10 @@
|
|
|
556
578
|
"title": "Mocha plugin configuration (https://knip.dev/reference/plugins/msw)",
|
|
557
579
|
"$ref": "#/definitions/plugin"
|
|
558
580
|
},
|
|
581
|
+
"nano-spawn": {
|
|
582
|
+
"title": "nano-spawn plugin configuration (https://knip.dev/reference/plugins/nano-spawn)",
|
|
583
|
+
"$ref": "#/definitions/plugin"
|
|
584
|
+
},
|
|
559
585
|
"nano-staged": {
|
|
560
586
|
"title": "nano-staged plugin configuration (https://knip.dev/reference/plugins/nano-staged)",
|
|
561
587
|
"$ref": "#/definitions/plugin"
|
|
@@ -624,6 +650,10 @@
|
|
|
624
650
|
"title": "openapi-ts plugin configuration (https://knip.dev/reference/plugins/openapi-ts)",
|
|
625
651
|
"$ref": "#/definitions/plugin"
|
|
626
652
|
},
|
|
653
|
+
"orval": {
|
|
654
|
+
"title": "orval plugin configuration (https://knip.dev/reference/plugins/orval)",
|
|
655
|
+
"$ref": "#/definitions/plugin"
|
|
656
|
+
},
|
|
627
657
|
"oxfmt": {
|
|
628
658
|
"title": "oxfmt plugin configuration (https://knip.dev/reference/plugins/oxfmt)",
|
|
629
659
|
"$ref": "#/definitions/plugin"
|
package/dist/util/math.d.ts
DELETED
package/dist/util/math.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function getStats(values) {
|
|
2
|
-
if (values.length === 0)
|
|
3
|
-
return { min: 0, max: 0, sum: 0, median: 0 };
|
|
4
|
-
const sorted = values.sort((a, b) => a - b);
|
|
5
|
-
const min = sorted[0];
|
|
6
|
-
const max = sorted[sorted.length - 1];
|
|
7
|
-
const sum = sorted.reduce((a, b) => a + b, 0);
|
|
8
|
-
const mid = Math.floor(sorted.length / 2);
|
|
9
|
-
const median = sorted.length % 2 ? sorted[mid] : (sorted[mid - 1] + sorted[mid]) / 2;
|
|
10
|
-
return { min, max, sum, median };
|
|
11
|
-
}
|