@knip/mcp 0.0.22 → 0.0.23

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.
@@ -8,7 +8,7 @@ import { Tabs, TabItem } from '@astrojs/starlight/components';
8
8
 
9
9
  ## Requirements
10
10
 
11
- Knip v5 requires at least Node.js v18.18.0. Or Bun.
11
+ Knip v6 requires at least Node.js v20.19.0. Or Bun.
12
12
 
13
13
  Want to try Knip without installation? Visit [the playground][1].
14
14
 
@@ -99,24 +99,6 @@ knip --include-entry-exports
99
99
 
100
100
  Also see [includeEntryExports][5].
101
101
 
102
- ### `--include-libs`
103
-
104
- Getting false positives for exports consumed by external libraries? Try the
105
- `--include-libs` flag:
106
-
107
- ```sh
108
- knip --include-libs
109
- ```
110
-
111
- Also see [external libs][6].
112
-
113
- ### `--isolate-workspaces`
114
-
115
- By default, Knip optimizes performance using [workspace sharing][7] to existing
116
- TypeScript programs, based on the compatibility of their `compilerOptions`. This
117
- flag disables this behavior and creates one program per workspace, which is
118
- slower but memory usage is spread more evenly over time.
119
-
120
102
  ### `--no-gitignore`
121
103
 
122
104
  Ignore `.gitignore` files.
@@ -131,14 +113,14 @@ Lint only production source files. This excludes:
131
113
  - Storybook stories
132
114
  - `devDependencies` from `package.json`
133
115
 
134
- Read more at [Production Mode][8].
116
+ Read more at [Production Mode][6].
135
117
 
136
118
  ### `--strict`
137
119
 
138
120
  Isolate workspaces and consider only direct dependencies. Implies [production
139
- mode][9].
121
+ mode][7].
140
122
 
141
- Read more at [Production Mode][8].
123
+ Read more at [Production Mode][6].
142
124
 
143
125
  ### `--watch`
144
126
 
@@ -157,7 +139,7 @@ workspaces). The default behavior is to lint all configured workspaces.
157
139
 
158
140
  Shortcut: `-W`
159
141
 
160
- See [filter workspaces][10] for more details and examples.
142
+ See [filter workspaces][8] for more details and examples.
161
143
 
162
144
  ### `--directory [dir]`
163
145
 
@@ -172,8 +154,7 @@ Exclude provided issue types from report. Can be comma-separated or repeated.
172
154
  Example:
173
155
 
174
156
  ```sh
175
- knip --exclude classMembers,enumMembers
176
- knip --exclude classMembers --exclude enumMembers
157
+ knip --exclude enumMembers
177
158
  ```
178
159
 
179
160
  ### `--include`
@@ -187,7 +168,7 @@ knip --include files,dependencies
187
168
  knip --include files --include dependencies
188
169
  ```
189
170
 
190
- Available [issue types][11] when filtering output using `--include` or
171
+ Available [issue types][9] when filtering output using `--include` or
191
172
  `--exclude`:
192
173
 
193
174
  - `files`
@@ -196,10 +177,10 @@ Available [issue types][11] when filtering output using `--include` or
196
177
  - `unresolved`
197
178
  - `exports`
198
179
  - `nsExports`
199
- - `classMembers`
200
180
  - `types`
201
181
  - `nsTypes`
202
182
  - `enumMembers`
183
+ - `namespaceMembers`
203
184
  - `duplicates`
204
185
  - `catalog`
205
186
 
@@ -216,7 +197,7 @@ Shortcut to include all types of dependency issues:
216
197
  Shortcut to include all types of export issues:
217
198
 
218
199
  ```sh
219
- --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates
200
+ --include exports,nsExports,types,nsTypes,enumMembers,namespaceMembers,duplicates
220
201
  ```
221
202
 
222
203
  ### `--files`
@@ -251,7 +232,7 @@ knip --tags=+custom
251
232
  ```
252
233
 
253
234
  This way, you can either focus on or ignore specific tagged exports with tags
254
- you define yourself. This also works for individual class or enum members.
235
+ you define yourself. This also works for individual enum and namespace members.
255
236
 
256
237
  The default directive is `+` (include) and the `@` prefix is ignored, so the
257
238
  notation below is valid and will report only exports tagged `@lintignore` or
@@ -265,13 +246,13 @@ knip --tags @lintignore --tags @internal
265
246
 
266
247
  ### `--fix`
267
248
 
268
- Read more at [auto-fix][12].
249
+ Read more at [auto-fix][10].
269
250
 
270
251
  ### `--fix-type`
271
252
 
272
253
  Fix only issues of type, can be comma-separated or repeated.
273
254
 
274
- More info about fixable types at [issue types][11]
255
+ More info about fixable types at [issue types][9]
275
256
 
276
257
  ### `--allow-remove-files`
277
258
 
@@ -285,7 +266,7 @@ Format modified files after `--fix` using the local formatter.
285
266
 
286
267
  ### `--preprocessor [preprocessor]`
287
268
 
288
- Preprocess the results before providing it to the [reporter(s)][13].
269
+ Preprocess the results before providing it to the [reporter(s)][11].
289
270
 
290
271
  Can be repeated. Examples:
291
272
 
@@ -297,7 +278,7 @@ knip --preprocessor ./my-preprocessor.ts
297
278
  knip --preprocessor preprocessor-package
298
279
  ```
299
280
 
300
- Also see [Reporters & Preprocessors][14].
281
+ Also see [Reporters & Preprocessors][12].
301
282
 
302
283
  ### `--preprocessor-options [json]`
303
284
 
@@ -326,7 +307,7 @@ Can be repeated. Example:
326
307
  knip --reporter compact
327
308
  ```
328
309
 
329
- Also see [Reporters & Preprocessors][14].
310
+ Also see [Reporters & Preprocessors][12].
330
311
 
331
312
  ### `--reporter-options [json]`
332
313
 
@@ -372,7 +353,7 @@ The default exit codes:
372
353
 
373
354
  Shortcut: `-d`
374
355
 
375
- Show [debug output][15].
356
+ Show [debug output][13].
376
357
 
377
358
  ### `--memory`
378
359
 
@@ -402,9 +383,6 @@ knip --memory
402
383
  Total running time: 4.3s
403
384
  ```
404
385
 
405
- Can be used with [--isolate-workspaces][16] to see the difference in garbage
406
- collection during the process.
407
-
408
386
  ### `--memory-realtime`
409
387
 
410
388
  Use this if Knip crashes to still see memory usage info over time:
@@ -452,7 +430,7 @@ Total running time: 5s
452
430
  - `sum` the accumulated time of all invocations
453
431
 
454
432
  This is not yet available in Bun, since it does not support
455
- `performance.timerify` ([GitHub issue][17]).
433
+ `performance.timerify` ([GitHub issue][14]).
456
434
 
457
435
  ### `--performance-fn`
458
436
 
@@ -475,37 +453,34 @@ Total running time: 12.9s
475
453
 
476
454
  Trace exports to see where they are imported.
477
455
 
478
- Also see [Trace][18].
456
+ Also see [Trace][15].
479
457
 
480
458
  ### `--trace-dependency [name]`
481
459
 
482
460
  Trace package or binary name to see where it's referenced. Implies
483
- [--trace][19].
461
+ [--trace][16].
484
462
 
485
463
  ### `--trace-export [name]`
486
464
 
487
- Trace export name to see where it's imported. Implies [--trace][19].
465
+ Trace export name to see where it's imported. Implies [--trace][16].
488
466
 
489
467
  ### `--trace-file [path]`
490
468
 
491
- Trace file to see where its exports are imported. Implies [--trace][19].
469
+ Trace file to see where its exports are imported. Implies [--trace][16].
492
470
 
493
471
  [1]: https://bun.sh
494
472
  [2]: ../reference/known-issues.md
495
473
  [3]: https://no-color.org/
496
474
  [4]: https://www.npmjs.com/package/picocolors
497
475
  [5]: ./configuration.md#includeentryexports
498
- [6]: ../guides/handling-issues.mdx#external-libraries
499
- [7]: ../guides/performance.md#workspace-sharing
500
- [8]: ../features/production-mode.md
501
- [9]: #--production
502
- [10]: ../features/monorepos-and-workspaces.md#filter-workspaces
503
- [11]: ./issue-types.md
504
- [12]: ../features/auto-fix.mdx
505
- [13]: #--reporter-reporter
506
- [14]: ../features/reporters.md
507
- [15]: ../guides/troubleshooting.md#debug
508
- [16]: #--isolate-workspaces
509
- [17]: https://github.com/oven-sh/bun/issues/9271
510
- [18]: ../guides/troubleshooting.md#trace
511
- [19]: #--trace
476
+ [6]: ../features/production-mode.md
477
+ [7]: #--production
478
+ [8]: ../features/monorepos-and-workspaces.md#filter-workspaces
479
+ [9]: ./issue-types.md
480
+ [10]: ../features/auto-fix.mdx
481
+ [11]: #--reporter-reporter
482
+ [12]: ../features/reporters.md
483
+ [13]: ../guides/troubleshooting.md#debug
484
+ [14]: https://github.com/oven-sh/bun/issues/9271
485
+ [15]: ../guides/troubleshooting.md#trace
486
+ [16]: #--trace
@@ -16,7 +16,7 @@ In JSON, use the provided JSON schema:
16
16
 
17
17
  ```json title="knip.json"
18
18
  {
19
- "$schema": "https://unpkg.com/knip@5/schema.json"
19
+ "$schema": "https://unpkg.com/knip@6/schema.json"
20
20
  }
21
21
  ```
22
22
 
@@ -26,7 +26,7 @@ In JSONC, use the provided JSONC schema:
26
26
 
27
27
  ```json title="knip.jsonc"
28
28
  {
29
- "$schema": "https://unpkg.com/knip@5/schema-jsonc.json"
29
+ "$schema": "https://unpkg.com/knip@6/schema-jsonc.json"
30
30
  }
31
31
  ```
32
32
 
@@ -168,7 +168,7 @@ like so:
168
168
  ```
169
169
 
170
170
  This way, you can either focus on or ignore specific tagged exports with tags
171
- you define yourself. This also works for individual class or enum members.
171
+ you define yourself. This also works for individual enum and namespace members.
172
172
 
173
173
  The default directive is `+` (include) and the `@` prefix is ignored, so the
174
174
  notation below is valid and will report only exports tagged `@lintignore` or
@@ -288,8 +288,8 @@ Also see [Unused dependencies][11].
288
288
 
289
289
  ### `ignoreMembers`
290
290
 
291
- Array of class and enum members to exclude from the report. Regular expressions
292
- allowed. Example:
291
+ Array of enum and namespace members to exclude from the report. Regular
292
+ expressions allowed. Example:
293
293
 
294
294
  ```json title="knip.json"
295
295
  {
@@ -347,7 +347,7 @@ reporting other issues in those same files.
347
347
  {
348
348
  "ignoreIssues": {
349
349
  "src/generated/**": ["exports", "types"],
350
- "**/*.generated.ts": ["exports", "classMembers"]
350
+ "**/*.generated.ts": ["exports", "enumMembers", "namespaceMembers"]
351
351
  }
352
352
  }
353
353
  ```
@@ -394,7 +394,7 @@ If enabled, Knip will report unused exports in entry source files. But not in
394
394
  entry and configuration files as configured by plugins, such as `next.config.js`
395
395
  or `src/routes/+page.svelte`.
396
396
 
397
- This will also enable reporting unused members of exported classes and enums.
397
+ This will also enable reporting unused members of exported enums and namespaces.
398
398
 
399
399
  Set this option at root level to enable this globally, or within workspace
400
400
  configurations individually.
@@ -144,13 +144,13 @@ imports of internal modules or external dependencies, and so on.
144
144
  Even though a modular approach has its merits, for Knip it makes sense to have
145
145
  all the pieces in a single tool.
146
146
 
147
- Building up the module and dependency graphs requires non-standard module
147
+ Building up the module and dependency graphs requires more than standard module
148
148
  resolution and not only static but also dynamic analysis (i.e. actually load and
149
149
  execute modules), such as for parsers of plugins to receive the exported value
150
150
  of dynamic tooling configuration files. Additionally, [exports consumed by
151
- external libraries][8] require type information, as supported by the TypeScript
152
- backend. Last but not least, shell script parsing is required to find the right
153
- entry files, configuration files and dependencies accurately.
151
+ external libraries][8] require type information. Last but not least, shell
152
+ script parsing is required to find the right entry files, configuration files
153
+ and dependencies accurately.
154
154
 
155
155
  The rippling effect of plugins and recursively adding entry files and
156
156
  dependencies to build up the graphs is also exactly what's meant by
@@ -171,7 +171,7 @@ dependencies to build up the graphs is also exactly what's meant by
171
171
  - Through scripts inside template strings in source files such as:
172
172
 
173
173
  ```ts
174
- await $({ stdio: 'inherit' })`c8 node hydrate.js`; // execa
174
+ await $({ stdio: "inherit" })`c8 node hydrate.js`; // execa
175
175
  await $`node scripts/parse.js`; // bun/zx
176
176
  ```
177
177
 
@@ -207,14 +207,14 @@ in additional entry files recursively until no more entry files are found.
207
207
 
208
208
  ### What does Knip look for in source files?
209
209
 
210
- The TypeScript source file parser is powerful and fault-tolerant. Knip visits
211
- all nodes of the generated AST to find:
210
+ oxc-parser is powerful and fault-tolerant. Knip visits all nodes of the
211
+ generated AST to find:
212
212
 
213
213
  - Imports and dynamic imports of internal modules and external dependencies
214
214
  - Exports
215
215
  - Accessed properties on namespace imports and re-exports to track individual
216
216
  export usage
217
- - Calls to `require.resolve` and `import.meta.resolve`
217
+ - Calls to `require.resolve`, `import.meta.resolve` and more.
218
218
  - Scripts in template strings (passed to [script parser][11])
219
219
 
220
220
  ### What's in the graphs?
@@ -232,10 +232,11 @@ required to create the report including all issue types:
232
232
  - Unused exports
233
233
  - Unused exported types
234
234
  - Unused exported enum members
235
+ - Unused exported namespace members
235
236
  - Duplicate exports
236
237
 
237
238
  And optionally more issue types like individual exports and exported types in
238
- namespace imports, and unused class members.
239
+ namespace imports.
239
240
 
240
241
  The graphs allows to report more interesting details, such as:
241
242
 
@@ -249,11 +250,14 @@ The graphs allows to report more interesting details, such as:
249
250
 
250
251
  Knip reads the `package.json` file of each dependency. Most of the information
251
252
  required is in the lockfile as well, which would be more efficient. However,
252
- there are a few issues with this approach:
253
+ lockfiles lack some data, including:
253
254
 
254
255
  - It requires lockfile parsing for each lockfile format and version of each
255
256
  package manager.
256
257
  - The lockfile doesn't contain whether the package [has types included][12].
258
+ - The lockfile doesn't contain entry point fields (`main`, `module`, `exports`)
259
+ needed to resolve what a dependency actually exposes.
260
+ - The lockfile doesn't contain `bin` entries to determine installed binaries.
257
261
 
258
262
  ## Module Resolution
259
263
 
@@ -273,13 +277,10 @@ seem to meet all requirements to be usable on its own by Knip:
273
277
  - Don't resolve to type definition paths like `module.d.ts` but source code at
274
278
  `module.js`
275
279
 
276
- A few strategies have been tried and tweaked, and Knip currently uses a
277
- combination of [oxc-resolver][13], the TypeScript module resolver and a few
278
- customizations. This single custom module resolver function is hooked into the
279
- TypeScript compiler and language service hosts.
280
-
281
- Everything else is handled by `oxc-resolver` for things like [script
282
- parsing][11] and resolving references to files in other workspaces.
280
+ A few strategies have been tried and tweaked, and Knip currently uses
281
+ [oxc-resolver][13] with customizations for extension aliases, path aliases and
282
+ TypeScript-style resolution. This covers module resolution across all
283
+ workspaces, [script parsing][11] and references to files in other workspaces.
283
284
 
284
285
  ### How does Knip handle non-standard import syntax?
285
286
 
@@ -288,8 +289,8 @@ webpack loaders or Vite asset imports. Knip strips off the prefixes and suffixes
288
289
  in import specifiers like this:
289
290
 
290
291
  ```ts title="component.ts"
291
- import Icon from './icon.svg?raw';
292
- import Styles from '-!style-loader!css-loader?modules!./styles.css';
292
+ import Icon from "./icon.svg?raw";
293
+ import Styles from "-!style-loader!css-loader?modules!./styles.css";
293
294
  ```
294
295
 
295
296
  In this example, the `style-loader` and `css-loader` dependencies should be
@@ -307,10 +308,8 @@ perspective), it can be added as a workspace to the Knip configuration.
307
308
  Projects - in the context of TypeScript - are directories with a `tsconfig.json`
308
309
  file. They're not a concept in Knip.
309
310
 
310
- A TypeScript program has a 1-to-1 relationship with workspaces if they're
311
- analyzed in isolation. However, by default Knip optimizes for performance and
312
- utilizes [workspace sharing][14]. That's why debug output contains messages like
313
- "Installed 2 programs for 29 workspaces".
311
+ Knip analyzes all workspaces using a single module graph with a shared module
312
+ resolver.
314
313
 
315
314
  ### Why doesn't Knip match my TypeScript project structure?
316
315
 
@@ -332,32 +331,22 @@ Note that any directory with a `package.json` not listed in the root
332
331
  `package.json#workspaces` can be added to the Knip configuration manually to
333
332
  have it handled as a separate workspace.
334
333
 
335
- ### Why doesn't Knip analyze workspaces in isolation by default?
336
-
337
- Knip creates TypeScript programs to create a module graph and traverse file
338
- ASTs. In a monorepo, it would make a lot of sense to create one program per
339
- workspace. However, this slows down the whole process considerably. That's why
340
- Knip shares the files of multiple workspaces in a single program if their
341
- configuration allows it. This optimization is enabled by default, while it also
342
- allows the module resolver (one per program) to do some more caching.
343
-
344
- Also see [workspace sharing][14].
345
-
346
334
  ### Why doesn't Knip just use `ts.findReferences`?
347
335
 
348
336
  TypeScript has a very good "Find references" feature, that you might be using in
349
- your IDE as well. Yet at scale this becomes too slow. That's why Knip builds up
350
- its own module graph to look up export usages. Additional benefits for this
351
- comprehensive graph include:
337
+ your IDE as well. There are a few reasons Knip doesn't use it:
352
338
 
353
- - serializable and cacheable
354
- - enables more features
355
- - usable for other tools to build upon as well
339
+ - It requires the full TypeScript language service, which is heavy to
340
+ initialize.
341
+ - It must be called per symbol. A project with thousands of exports would need
342
+ thousands of calls, each scanning potentially all files. Knip parses each file
343
+ once and resolves all export usages from the resulting graph.
344
+ - It operates within a single TypeScript program. Monorepos with multiple
345
+ `tsconfig.json` files would need separate language service instances.
346
+ - It cannot see into non-standard files like `.vue`, `.svelte` and `.astro`.
356
347
 
357
- Without sacrificing these benefits, Knip does use `ts.findReferences` to find
358
- references to class members (i.e. when the issue type `classMembers` is
359
- included). In case analysis of exports requires type information of external
360
- dependencies, the [`--include-libs ` flag][8] will trigger the same.
348
+ Knip's module graph is also serializable and cacheable, and usable for other
349
+ tools to build upon.
361
350
 
362
351
  ### Why can't I use path aliases to reference other workspaces?
363
352
 
@@ -369,19 +358,19 @@ The recommendation and best practice is to list such workspaces/dependencies in
369
358
  `package.json`, and import them as such. Other tooling should not have any
370
359
  issues with this standard approach either.
371
360
 
372
- Also see the example in [TypeScript path aliases in monorepos][15].
361
+ Also see the example in [TypeScript path aliases in monorepos][14].
373
362
 
374
363
  ### What's up with that configurable `tsconfig.json` location?
375
364
 
376
365
  There's a difference between `--tsConfig [file]` as a CLI argument and the
377
366
  `typescript.config` option in Knip configuration.
378
367
 
379
- The [`--tsConfig [file]` option][16] is used to provide an alternative location
368
+ The [`--tsConfig [file]` option][15] is used to provide an alternative location
380
369
  for the default root `tsconfig.json` file. Relevant `compilerOptions` include
381
370
  `paths` and `moduleResolution`. This setting is only available at the root
382
371
  level.
383
372
 
384
- On the other hand, the [`config` option of the plugin][17] can be set per
373
+ On the other hand, the [`config` option of the plugin][16] can be set per
385
374
  workspace. The TypeScript plugin extracts referenced external dependencies such
386
375
  as those in `extends`, `compilerOptions.types` and JSX settings:
387
376
 
@@ -405,7 +394,7 @@ From this example, Knip can determine whether the `@tsconfig/node20` and
405
394
  for `tsconfig.json` can be set per workspace.
406
395
  - In case path aliases from `compilerOptions.paths` aren't picked up by Knip,
407
396
  either use `--tsConfig [file]` to target a different `tsconfig.json`, or
408
- manually add [paths][18] to the Knip configuration. The latter can be done per
397
+ manually add [paths][17] to the Knip configuration. The latter can be done per
409
398
  workspace.
410
399
 
411
400
  ## Compilers
@@ -418,17 +407,16 @@ than JavaScript and TypeScript modules should be included as well. For instance,
418
407
  dependencies.
419
408
 
420
409
  Knip includes basic "compilers" for a few common file types (Astro, MDX, Svelte,
421
- Vue). Knip does not include actual compilers for reasons of potential
422
- incompatibility with the existing compiler, and dependency size. Knip allows to
423
- override them with the compilers in your project, and add additional ones for
424
- other file types.
410
+ Vue). These are lightweight regex-based extractors, not actual compilers. You
411
+ can override the built-in compilers with your project's actual compiler, and add
412
+ additional ones for other file types.
425
413
 
426
414
  ### Why are the exports of my `.vue` files not used?
427
415
 
428
416
  Knip comes with basic "compilers" for a few common non-standard file types.
429
417
  They're not actual compilers, they're regular expressions only to extract import
430
418
  statements. Override the built-in Vue "compiler" with the real one in your
431
- project. Also see the answer to the previous question and [Compilers][19].
419
+ project. Also see the answer to the previous question and [Compilers][18].
432
420
 
433
421
  ## Miscellaneous
434
422
 
@@ -464,12 +452,10 @@ Examples of features that have been requested include:
464
452
  - Analyze workspaces in parallel
465
453
  - Support Deno
466
454
  - Improve internal code structures and accessibility to support contributions
467
- - Replace dependencies for better performance and correctness, such as for shell
468
- script parsing and globbing with "unignores".
469
455
 
470
456
  These are all interesting ideas, but most increase the API surface area, and all
471
457
  require more development efforts and maintenance. Time is limited and
472
- [sponsorships][20] currently don't cover - this can change though!
458
+ [sponsorships][19] currently don't cover - this can change though!
473
459
 
474
460
  [1]: ../reference/integrations.md#mcp-server
475
461
  [2]: ../reference/integrations.md#vs-code-extension
@@ -484,10 +470,9 @@ require more development efforts and maintenance. Time is limited and
484
470
  [11]: ../features/script-parser.md
485
471
  [12]: ../guides/handling-issues.mdx#type-definition-packages
486
472
  [13]: https://oxc.rs/docs/guide/usage/resolver.html
487
- [14]: ../guides/performance.md#workspace-sharing
488
- [15]: ../guides/handling-issues.mdx#typescript-path-aliases-in-monorepos
489
- [16]: ../reference/cli.md#--tsconfig-file
490
- [17]: ../explanations/plugins.md#configuration-files
491
- [18]: ../reference/configuration.md#paths
492
- [19]: ../features/compilers.md
493
- [20]: /sponsors
473
+ [14]: ../guides/handling-issues.mdx#typescript-path-aliases-in-monorepos
474
+ [15]: ../reference/cli.md#--tsconfig-file
475
+ [16]: ../explanations/plugins.md#configuration-files
476
+ [17]: ../reference/configuration.md#paths
477
+ [18]: ../features/compilers.md
478
+ [19]: /sponsors
@@ -5,23 +5,23 @@ tableOfContents: false
5
5
 
6
6
  Knip reports the following types of issues:
7
7
 
8
- | Title | Description | | Key |
9
- | :----------------------------------- | :---------------------------------------------------- | ----- | :------------------------- |
10
- | Unused files | Unable to find a reference to this file | 🔧 | `files` |
11
- | Unused dependencies | Unable to find a reference to this dependency | 🔧 | `dependencies` |
12
- | Unused devDependencies | Unable to find a reference to this devDependency | 🔧 | `devDependencies` |
13
- | Referenced optional peerDependencies | Optional peer dependency is used | | `optionalPeerDependencies` |
14
- | Unlisted dependencies | Used dependencies not listed in package.json | | `unlisted` |
15
- | Unlisted binaries | Binaries from dependencies not listed in package.json | | `binaries` |
16
- | Unused catalog entries | Unable to find a reference to this catalog entry | 🔧 | `catalog` |
17
- | Unresolved imports | Unable to resolve this (import) specifier | | `unresolved` |
18
- | Unused exports | Unable to find a reference to this export | 🔧 | `exports` |
19
- | Unused exported types | Unable to find a reference to this exported type | 🔧 | `types` |
20
- | Exports in used namespace | Namespace with export is used, but not export itself | 🔧 🟠 | `nsExports` |
21
- | Exported types in used namespace | Namespace with type is used, but not type itself | 🔧 🟠 | `nsTypes` |
22
- | Unused exported enum members | Unable to find a reference to this enum member | 🔧 | `enumMembers` |
23
- | Unused exported class members | Unable to find a reference to this class member | 🔧 🟠 | `classMembers` |
24
- | Duplicate exports | This is exported more than once | | `duplicates` |
8
+ | Title | Description | | Key |
9
+ | :----------------------------------- | :--------------------------------------------------------- | ----- | :----------------- |
10
+ | Unused files | Unable to find a reference to this file | 🔧 | `files` |
11
+ | Unused dependencies | Unable to find a reference to this dependency | 🔧 | `dependencies` |
12
+ | Unused devDependencies | Unable to find a reference to this devDependency | 🔧 | `dependencies` |
13
+ | Referenced optional peerDependencies | Optional peer dependency is referenced | | `dependencies` |
14
+ | Unlisted dependencies | Used dependencies not listed in package.json | | `unlisted` |
15
+ | Unlisted binaries | Binaries from dependencies not listed in package.json | | `binaries` |
16
+ | Unused catalog entries | Unable to find a reference to this catalog entry | 🔧 | `catalog` |
17
+ | Unresolved imports | Unable to resolve this (import) specifier | | `unresolved` |
18
+ | Unused exports | Unable to find a reference to this export | 🔧 | `exports` |
19
+ | Unused exported types | Unable to find a reference to this exported type | 🔧 | `types` |
20
+ | Exports in used namespace | Namespace with export is referenced, but not export itself | 🔧 🟠 | `nsExports` |
21
+ | Exported types in used namespace | Namespace with type is referenced, but not type itself | 🔧 🟠 | `nsTypes` |
22
+ | Unused exported enum members | Unable to find a reference to this enum member | 🔧 | `enumMembers` |
23
+ | Unused exported namespace members | Unable to find a reference to this namespace member | 🔧 | `namespaceMembers` |
24
+ | Duplicate exports | This is exported more than once | | `duplicates` |
25
25
 
26
26
  ## Legend
27
27
 
@@ -55,9 +55,9 @@ them to ensure no unintended modifications were made.
55
55
 
56
56
  ## Can Knip handle large codebases?
57
57
 
58
- Absolutely. Knip supports [monorepos with workspaces][5] and utilizes [workspace
59
- sharing][6] to efficiently analyze large monorepos. This makes it easier and
60
- more fun to manage and optimize large multi-package projects.
58
+ Absolutely. Knip supports [monorepos with workspaces][5] to efficiently analyze
59
+ large monorepos. This makes it easier and more fun to manage and optimize large
60
+ multi-package projects.
61
61
 
62
62
  ## Does Knip work with my favorite editor or IDE?
63
63
 
@@ -70,18 +70,17 @@ to easily navigate around.
70
70
 
71
71
  While linters like ESLint can find unused imports and variables within
72
72
  individual files, Knip analyzes the entire project to determine which exports
73
- are actually unused. By building [a comprehensive module graph][7], Knip
73
+ are actually unused. By building [a comprehensive module graph][6], Knip
74
74
  identifies exports that are not imported or used anywhere in the codebase. This
75
75
  allows Knip to catch unused exports and dead code that ESLint and other linters
76
76
  would miss.
77
77
 
78
- Also see [Why isn't Knip an ESLint plugin?][8]
78
+ Also see [Why isn't Knip an ESLint plugin?][7]
79
79
 
80
80
  [1]: ../overview/getting-started.mdx
81
81
  [2]: ../reference/faq.md#what-does-knip-look-for-in-source-files
82
82
  [3]: ../guides/working-with-commonjs.md
83
83
  [4]: ../features/auto-fix.mdx
84
84
  [5]: ../features/monorepos-and-workspaces.md
85
- [6]: ../guides/performance.md#workspace-sharing
86
- [7]: ../reference/faq.md#whats-in-the-graphs
87
- [8]: ../reference/faq.md#why-isnt-knip-an-eslint-plugin
85
+ [6]: ../reference/faq.md#whats-in-the-graphs
86
+ [7]: ../reference/faq.md#why-isnt-knip-an-eslint-plugin