@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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knip/mcp",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "Knip MCP Server",
5
5
  "keywords": [
6
6
  "knip",
@@ -28,10 +28,10 @@
28
28
  "dependencies": {
29
29
  "@modelcontextprotocol/sdk": "^1.27.1",
30
30
  "zod": "^4.1.11",
31
- "knip": "^5.88.1"
31
+ "knip": "^6.0.0"
32
32
  },
33
33
  "engines": {
34
- "node": ">=18.18.0"
34
+ "node": "^20.19.0 || >=22.12.0"
35
35
  },
36
36
  "scripts": {
37
37
  "release": "release-it -c ../../.release-it.json"
@@ -2,7 +2,7 @@
2
2
  title: A Brief History Of Knip
3
3
  date: 2023-10-15
4
4
  sidebar:
5
- order: 7
5
+ order: 8
6
6
  ---
7
7
 
8
8
  _Published: 2023-10-15_
@@ -2,7 +2,7 @@
2
2
  title: Knip for Editors & Agents
3
3
  date: 2025-12-17
4
4
  sidebar:
5
- order: 1
5
+ order: 2
6
6
  ---
7
7
 
8
8
  _Published: 2025-12-17_
@@ -2,7 +2,7 @@
2
2
  title: Announcing Knip v3
3
3
  date: 2023-10-15
4
4
  sidebar:
5
- order: 8
5
+ order: 9
6
6
  ---
7
7
 
8
8
  import { Tabs, TabItem } from '@astrojs/starlight/components';
@@ -2,7 +2,7 @@
2
2
  title: Announcing Knip v4
3
3
  date: 2024-01-16
4
4
  sidebar:
5
- order: 5
5
+ order: 6
6
6
  ---
7
7
 
8
8
  import { Tabs, TabItem } from '@astrojs/starlight/components';
@@ -2,7 +2,7 @@
2
2
  title: Announcing Knip v5
3
3
  date: 2024-02-10
4
4
  sidebar:
5
- order: 4
5
+ order: 5
6
6
  ---
7
7
 
8
8
  import { Tabs, TabItem } from '@astrojs/starlight/components';
@@ -0,0 +1,145 @@
1
+ ---
2
+ title: Announcing Knip v6
3
+ date: 2026-03-20
4
+ sidebar:
5
+ order: 1
6
+ ---
7
+
8
+ _Published: 2026-03-20_
9
+
10
+ ## Knip v6 is out!
11
+
12
+ This release is all about replacing the TypeScript backend entirely with
13
+ `oxc-parser` and `oxc-resolver`, and making Knip a whole lot faster!
14
+
15
+ ## From TypeScript to oxc
16
+
17
+ Two years ago, the ["slim down to speed up"][1] and [Knip v4][2] work removed a
18
+ lot of overhead around TypeScript programs, made serialization and caching
19
+ practical, and improved memory efficiency a lot. But there was still a ceiling:
20
+ parsing and module resolution still depended on TypeScript APIs designed for
21
+ IDEs and language servers — not for the kind of single-pass static analysis Knip
22
+ does.
23
+
24
+ Starting today, Knip v6 parses your source files with [oxc-parser][3]. This is
25
+ more than just a parser swap for the sake of using the latest 'n greatest.
26
+
27
+ Knip has always been designed to parse each file only once, but the TypeScript
28
+ backend carried the overhead of wiring up an entire program along with the
29
+ typechecker. That's useful for IDEs keeping symbols connected, but much less so
30
+ when you only need to traverse an AST once to collect imports and exports.
31
+ The TypeScript backend made the setup as a whole harder and slower than it
32
+ needed to be, especially to keep large monorepos in check.
33
+
34
+ Now with TypeScript itself Go-ing places, replacing that backend was only a
35
+ matter of time.
36
+
37
+ Unsurprisingly, the search didn't take long: `oxc-parser` offers everything we
38
+ need and its (experimental) raw transfer is crazy fast. Massive props to
39
+ [overlookmotel][4], [Boshen][5] and all contributors for all the work on
40
+ [the oxc suite][6]!
41
+
42
+ ## Performance tuning
43
+
44
+ Next to this major refactor, I've been having a ball tuning Knip's performance
45
+ further. One thing to highlight here is that a few more plugins have been
46
+ refactored to statically analyze configuration files directly, as opposed to
47
+ actually importing them (including transitive dependencies...). This includes
48
+ the ESLint ("flat config"), tsdown and tsup plugins.
49
+
50
+ ## The numbers
51
+
52
+ Comparing v5 and v6 in some projects using Knip, all boosts are in the **2-4x** range:
53
+
54
+ [![venz-chart][8]][7]
55
+
56
+ Trust me, I could look at this chart all day long! The same numbers in a table:
57
+
58
+ | Project | v5.88.0 | v6.0.0 |
59
+ | ---------------- | ------: | -----: |
60
+ | [astro][9] | 4.0s | 2.0s |
61
+ | [query][10] | 3.8s | 1.7s |
62
+ | [rolldown][11] | 3.7s | 1.7s |
63
+ | [sentry][12] | 11.0s | 4.0s |
64
+ | [TypeScript][13] | 3.7s | 0.9s |
65
+
66
+ ## What's new
67
+
68
+ - Did I already mention Knip got 2-4x faster?
69
+ - Support for TS namespaces (and modules), new issue type `namespaceMembers`:
70
+
71
+ ```ts
72
+ export namespace MyNamespace {
73
+ export const myName = 'knip'; // we were ignored in v5,
74
+ export type MyType = string; // yet in v6 we are included
75
+ }
76
+ ```
77
+
78
+ ## Breaking changes
79
+
80
+ Granted, most of you won't even notice. Here's the list:
81
+
82
+ - Dropped support for Node.js v18 → Knip v6 requires Node.js v20.19.0 or newer
83
+ - Dropped issue type `classMembers`
84
+ - Dropped `--include-libs` → this is now the default and only behavior
85
+ - Dropped `--isolate-workspaces` → this is now the default and only behavior
86
+ - Dropped `--experimental-tags` → use [`--tags`][14]
87
+ - In [reporter functions][15], `issues.files` is consistent with other issue shapes. Removed `issues._files`.
88
+ - In the [JSON reporter][16], issues are consistently arrays for any issue type. Removed root `files`.
89
+
90
+ ## Editor Extensions
91
+
92
+ [Editor extensions][17] benefit from the core upgrades, for being faster and more
93
+ memory-efficient. Regardless of new extension releases, the local version of
94
+ Knip will be detected and used. Upgrade `knip` in your dependencies when you're
95
+ ready.
96
+
97
+ ## What about classMembers?
98
+
99
+ I feel you. Even Knip itself was using it. Until today.
100
+
101
+ The problem is that the implementation relies on the JS-based `ts.LanguageService`
102
+ API that exposes the `findReferences` method. TypeScript v6 is the last JS-based
103
+ release, and TypeScript v7 is a full rewrite in Go. I am left wondering if it
104
+ ever will be feasible and practical to build such features using primitives
105
+ (i.e. not via LSP) in a JS-based CLI (references: [microsoft/typescript-go#455][18],
106
+ [@typescript/api][19]). Knip was already pretty unique for even trying this in
107
+ a CLI tool.
108
+
109
+ Not that many projects seem to be using it either:
110
+ [github.com search for "classMembers path\:knip.json"][20].
111
+
112
+ If your project relies on it, feel free to open an issue on GitHub or contact me
113
+ and maybe we can work something out. Maybe a separate dedicated tool could work,
114
+ or extended support for Knip v5.
115
+
116
+ ## Upgrade today
117
+
118
+ ```sh
119
+ npm install -D knip@latest
120
+ ```
121
+
122
+ ## Deep closing thoughts...
123
+
124
+ Remember, Knip it before you ship it! Have a great day ☀️
125
+
126
+ [1]: ./slim-down-to-speed-up.md
127
+ [2]: ./knip-v4.mdx
128
+ [3]: https://oxc.rs/docs/guide/usage/parser
129
+ [4]: https://github.com/overlookmotel
130
+ [5]: https://github.com/Boshen
131
+ [6]: https://oxc.rs
132
+ [7]: https://try.venz.dev/?type=bar&labelX=Knip&labelY=duration+(s)&label=astro&label=query&label=rolldown&label=sentry&label=typescript&l=v5.88.0&l=v6.0.0&data=4*2&data=3.8*1.7&data=3.7*1.7&data=11*4&data=3.7*0.9
133
+ [8]: https://cdn.venz.dev/i/chart.svg?pad=0&type=bar&labelX=Knip&labelY=duration+(s)&label=astro&label=query&label=rolldown&label=sentry&label=typescript&l=v5.88.0&l=v6.0.0&data=4*2&data=3.8*1.7&data=3.7*1.7&data=11*4&data=3.7*0.9&theme=dark
134
+ [9]: https://github.com/withastro/astro
135
+ [10]: https://github.com/TanStack/query
136
+ [11]: https://github.com/rolldown/rolldown
137
+ [12]: https://github.com/getsentry/sentry
138
+ [13]: https://github.com/microsoft/TypeScript
139
+ [14]: ../reference/configuration.md#tags
140
+ [15]: ../features/reporters.md#custom-reporters
141
+ [16]: ../features/reporters.md#json
142
+ [17]: ../reference/integrations.md
143
+ [18]: https://github.com/microsoft/typescript-go/discussions/455
144
+ [19]: https://github.com/microsoft/typescript-go/tree/main/_packages/api
145
+ [20]: https://github.com/search?q=classMembers%20path%3Aknip.json&type=code
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: Release Notes v2
3
3
  sidebar:
4
- order: 9
4
+ order: 10
5
5
  ---
6
6
 
7
7
  _2023-03-22_
@@ -2,7 +2,7 @@
2
2
  title: Slim down to speed up
3
3
  date: 2023-12-14
4
4
  sidebar:
5
- order: 6
5
+ order: 7
6
6
  ---
7
7
 
8
8
  _Published: 2023-12-14_
@@ -2,7 +2,7 @@
2
2
  title: The State of Knip
3
3
  date: 2025-02-28
4
4
  sidebar:
5
- order: 2
5
+ order: 3
6
6
  ---
7
7
 
8
8
  _Published: 2025-02-28_
@@ -2,7 +2,7 @@
2
2
  title: Two Years
3
3
  date: 2024-10-04
4
4
  sidebar:
5
- order: 3
5
+ order: 4
6
6
  ---
7
7
 
8
8
  _Published: 2024-10-04_
@@ -71,7 +71,7 @@ ts-prune
71
71
  knip --include exports,types,nsExports,nsTypes
72
72
  ```
73
73
 
74
- Use `knip --exports` to also include class and enum members.
74
+ Use `knip --exports` to also include enum and namespace members.
75
75
 
76
76
  **Project status**: The project is archived and recommends Knip.
77
77
 
@@ -87,7 +87,7 @@ ts-unused-exports
87
87
  knip --include exports,types,nsExports,nsTypes
88
88
  ```
89
89
 
90
- Use `knip --exports` to also include class and enum members.
90
+ Use `knip --exports` to also include enum and namespace members.
91
91
 
92
92
  ### tsr
93
93
 
@@ -11,8 +11,7 @@ following [issue types][1]:
11
11
 
12
12
  - Remove `export` keyword for unused exports, re-exports, and exported types
13
13
  - Remove `export default` keywords for unused default exports
14
- - Remove unused enum members
15
- - Remove unused class members (disabled by default)
14
+ - Remove unused enum and namespace members
16
15
  - Remove unused `dependencies` and `devDependencies` from `package.json`
17
16
  - Remove unused files
18
17
  - Remove unused catalog entries
@@ -288,37 +287,9 @@ Unused dependencies are removed from `package.json`:
288
287
  }
289
288
  ```
290
289
 
291
- ### Class members   <Badge text="experimental" variant="caution" />
292
-
293
- Unused members of classes can be removed:
294
-
295
- ```diff title="file.ts"
296
- export class Rectangle {
297
- constructor(public width: number, public height: number) {}
298
-
299
- - static Key = 1;
300
- +
301
-
302
- area() {
303
- return this.width * this.height;
304
- }
305
-
306
- - public get unusedGetter(): string {
307
- - return 'unusedGetter';
308
- - }
309
- }
310
- ```
311
-
312
- Currently Knip might be too eager removing class members when they're not
313
- referenced internally but meant to be called by an external library. For
314
- instance, Knip might think `componentDidMount` and `render` in React class
315
- component are unused and will remove those.
316
-
317
- Note that [`classMembers` aren't included by default][4].
318
-
319
290
  ### Catalog entries
320
291
 
321
- Unused [catalog][5] entries are removed from `pnpm-workspace.yaml`:
292
+ Unused [catalog][4] entries are removed from `pnpm-workspace.yaml`:
322
293
 
323
294
  ```diff title="pnpm-workspace.yaml"
324
295
  packages:
@@ -344,5 +315,4 @@ Operations that auto-fix does not (yet) perform and why:
344
315
  [1]: ../reference/issue-types.md
345
316
  [2]: https://github.com/JoshuaKGoldberg/formatly
346
317
  [3]: https://github.com/webpro-nl/remove-unused-vars
347
- [4]: ../guides/handling-issues.mdx#class-members
348
- [5]: https://pnpm.io/catalogs
318
+ [4]: https://pnpm.io/catalogs
@@ -29,7 +29,6 @@ object per file structured like this:
29
29
 
30
30
  ```json
31
31
  {
32
- "files": ["src/unused.ts"],
33
32
  "issues": [
34
33
  {
35
34
  "file": "package.json",
@@ -55,18 +54,22 @@ object per file structured like this:
55
54
  { "name": "unusedEnum", "line": 3, "col": 13, "pos": 71 },
56
55
  { "name": "unusedType", "line": 8, "col": 14, "pos": 145 }
57
56
  ],
58
- "enumMembers": {
59
- "MyEnum": [
60
- { "name": "unusedMember", "line": 13, "col": 3, "pos": 167 },
61
- { "name": "unusedKey", "line": 15, "col": 3, "pos": 205 }
62
- ]
63
- },
64
- "classMembers": {
65
- "MyClass": [
66
- { "name": "unusedMember", "line": 40, "col": 3, "pos": 687 },
67
- { "name": "unusedSetter", "line": 61, "col": 14, "pos": 1071 }
68
- ]
69
- },
57
+ "enumMembers": [
58
+ {
59
+ "namespace": "MyEnum",
60
+ "name": "unusedMember",
61
+ "line": 13,
62
+ "col": 3,
63
+ "pos": 167
64
+ },
65
+ {
66
+ "namespace": "MyEnum",
67
+ "name": "unusedKey",
68
+ "line": 15,
69
+ "col": 3,
70
+ "pos": 205
71
+ }
72
+ ],
70
73
  "duplicates": ["Registration", "default"]
71
74
  }
72
75
  ]
@@ -52,6 +52,7 @@ Knip has shortcuts to include only specific issue types.
52
52
  - `exports`
53
53
  - `types`
54
54
  - `enumMembers`
55
+ - `namespaceMembers`
55
56
  - `duplicates`
56
57
 
57
58
  3. The `--files` flag is a shortcut for `--include files`
@@ -73,7 +74,6 @@ Example:
73
74
  {
74
75
  "rules": {
75
76
  "files": "warn",
76
- "classMembers": "off",
77
77
  "duplicates": "off"
78
78
  }
79
79
  }
@@ -517,7 +517,7 @@ option][39] to tell Knip where to find the icon types:
517
517
  Where `[framework]` is the name of the framework you're using (see [available
518
518
  types][42]).
519
519
 
520
- **Solution**: try [--include-libs][43] or configure [paths][39].
520
+ **Solution**: configure [paths][39].
521
521
 
522
522
  ## Unused exports
523
523
 
@@ -525,8 +525,8 @@ By default, Knip does not report unused exports of `entry` files.
525
525
 
526
526
  The most common causes for unused exports include:
527
527
 
528
- - [Namespace enumerations][44]
529
- - [External libraries][45]
528
+ - [Namespace enumerations][43]
529
+ - [External libraries][44]
530
530
 
531
531
  Use the `--exports` flag to [filter][17] and focus only on issues related to
532
532
  exports:
@@ -535,7 +535,7 @@ exports:
535
535
  knip --exports
536
536
  ```
537
537
 
538
- Use [includeEntryExports][46] to report unused exports of entry files as well.
538
+ Use [includeEntryExports][45] to report unused exports of entry files as well.
539
539
  This can be set per workspace.
540
540
 
541
541
  ### Namespace enumerations
@@ -547,7 +547,7 @@ are then **not** reported.
547
547
  **Solution**: if all exports on imported namespaces should be considered
548
548
  individually, include the `nsExports` issue type to disable the heuristic.
549
549
 
550
- See [namespace imports][47] to see all related patterns.
550
+ See [namespace imports][46] to see all related patterns.
551
551
 
552
552
  ### External libraries
553
553
 
@@ -578,27 +578,16 @@ non-standard consumption of your exports? Here's an example:
578
578
  </Tabs>
579
579
 
580
580
  Knip understands `Apple` is used, since it's standard usage. But `Orange` is
581
- referenced through a function of an external library. For performance reasons,
582
- Knip does not include external type definitions by default so it won't see the
583
- export being referenced.
584
-
585
- **Solution**: include the type definitions of external libraries with the
586
- [--include-libs][43] flag:
587
-
588
- ```shell
589
- knip --include-libs
590
- ```
591
-
592
- This comes at a performance and memory penalty, but should give better results
593
- if you need it. This flag is implied when [classMembers][48] are included (that
594
- feature comes with roughly the same performance penalty).
581
+ referenced through a function of an external library. Knip includes external
582
+ type definitions to trace such usage, but in some cases it may not be able to
583
+ follow the reference through the library's API.
595
584
 
596
585
  ### Exclude exports from the report
597
586
 
598
587
  To exclude false positives from the report, there are a few options:
599
588
 
600
- - [Ignore exports used in file][49] for exports used internally.
601
- - Individual exports can be [tagged using JSDoc syntax][50].
589
+ - [Ignore exports used in file][47] for exports used internally.
590
+ - Individual exports can be [tagged using JSDoc syntax][48].
602
591
  - Have the export in an entry file:
603
592
 
604
593
  - Add the file to the `entry` file patterns array in the configuration.
@@ -609,50 +598,47 @@ To exclude false positives from the report, there are a few options:
609
598
  ### Missing unused exports?
610
599
 
611
600
  Did you expect certain exports in the report, but are they missing? They might
612
- be exported from an entry file. In that case, use [--include-entry-exports][46]
601
+ be exported from an entry file. In that case, use [--include-entry-exports][45]
613
602
  to make Knip also report unused exports in entry files.
614
603
 
615
604
  The exports of non-standard extensions like `.astro`, `.mdx`, `.vue` or
616
605
  `.svelte` are not available by default. See [compilers][21] for more details on
617
606
  how to include them.
618
607
 
619
- ### Class members
608
+ ### Enum members
620
609
 
621
- Unused members of exported classes are not reported by default, here's how to
622
- enable them:
610
+ Unused enums and unused members of exported enums are reported by default.
611
+ Reporting such members can be disabled:
623
612
 
624
613
  ```sh
625
- knip --include classMembers
614
+ knip --exclude enumMembers
626
615
  ```
627
616
 
628
- This option is also available in the Knip configuration file. Note that this
629
- feature comes at a cost: linting will take more time and more memory.
630
-
631
- Individual class members can be [tagged using JSDoc syntax][50].
617
+ Individual enum members can be [tagged using JSDoc syntax][48].
632
618
 
633
- Classes exported from entry files are ignored, and so are their members. Use
634
- [--include-entry-exports][46] to make Knip also report members of unused exports
619
+ Enums exported from entry files are ignored, and so are their members. Use
620
+ [--include-entry-exports][45] to make Knip also report members of unused exports
635
621
  in entry files.
636
622
 
637
- ### Enum members
623
+ ### Namespace members
638
624
 
639
- Unused enums and unused members of exported enums are reported by default.
625
+ Unused members of exported TypeScript namespaces are reported by default.
640
626
  Reporting such members can be disabled:
641
627
 
642
628
  ```sh
643
- knip --exclude enumMembers
629
+ knip --exclude namespaceMembers
644
630
  ```
645
631
 
646
- Individual enum members can be [tagged using JSDoc syntax][50].
632
+ Individual namespace members can be [tagged using JSDoc syntax][48].
647
633
 
648
- Enums exported from entry files are ignored, and so are their members. Use
649
- [--include-entry-exports][46] to make Knip also report members of unused exports
634
+ Namespaces exported from entry files are ignored, and so are their members. Use
635
+ [--include-entry-exports][45] to make Knip also report members of unused exports
650
636
  in entry files.
651
637
 
652
638
  ## Feedback or false positives?
653
639
 
654
640
  If you believe Knip incorrectly reports something as unused (i.e. there's a
655
- false positive), feel free to create a [minimal reproduction][51] and open an
641
+ false positive), feel free to create a [minimal reproduction][49] and open an
656
642
  issue on GitHub. It'll make Knip better for everyone!
657
643
 
658
644
  [1]: #unused-files
@@ -697,12 +683,10 @@ issue on GitHub. It'll make Knip better for everyone!
697
683
  [40]: ../reference/configuration.md#ignoreunresolved
698
684
  [41]: https://www.npmjs.com/package/unplugin-icons
699
685
  [42]: https://github.com/unplugin/unplugin-icons/tree/main/types
700
- [43]: ../reference/cli.md#--include-libs
701
- [44]: #namespace-enumerations
702
- [45]: #external-libraries
703
- [46]: ../reference/configuration.md#includeentryexports
704
- [47]: ../guides/namespace-imports.md
705
- [48]: #class-members
706
- [49]: ../reference/configuration.md#ignoreexportsusedinfile
707
- [50]: ../reference/jsdoc-tsdoc-tags.md
708
- [51]: ../guides/issue-reproduction.md
686
+ [43]: #namespace-enumerations
687
+ [44]: #external-libraries
688
+ [45]: ../reference/configuration.md#includeentryexports
689
+ [46]: ../guides/namespace-imports.md
690
+ [47]: ../reference/configuration.md#ignoreexportsusedinfile
691
+ [48]: ../reference/jsdoc-tsdoc-tags.md
692
+ [49]: ../guides/issue-reproduction.md
@@ -23,72 +23,19 @@ exclude files from the analysis.
23
23
  Read [configuring project files][1] for details and examples. Improving
24
24
  configuration may have a significant impact on performance.
25
25
 
26
- ## Workspace sharing
27
-
28
- Knip shares files from separate workspaces if the configuration in
29
- `tsconfig.json` allows this. This aims to reduce memory consumption and run
30
- duration. Relevant compiler options include `baseUrl`, `paths` and
31
- `moduleResolution`.
32
-
33
- With the `--debug` flag you can see how many programs Knip uses. Look for
34
- messages like this:
35
-
36
- ```sh
37
- ...
38
- [*] Installed 2 programs for 29 workspaces
39
- ...
40
- [*] Analyzing used resolved files [P1/1] (123)
41
- ...
42
- [*] Analyzing used resolved files [P1/2] (8)
43
- ...
44
- [*] Analyzing used resolved files [P2/1] (41)
45
- ...
46
- ```
47
-
48
- The first number in `P1/1` is the number of the programs, the second number
49
- indicates additional entry files were found so it does another round of analysis
50
- on those files.
51
-
52
- Use [--isolate-workspaces][2] to disable this behavior. This is usually not
53
- necessary, but more of an escape hatch in cases with memory usage issues or
54
- incompatible `compilerOptions` across workspaces. Workspaces are analyzed
55
- sequentially to spread out memory usage more evenly, which may prevent crashes
56
- on large monorepos.
57
-
58
- ## Language Service
59
-
60
- Knip does not install the TypeScript Language Service (LS) by default. This is
61
- expensive, as TypeScript needs to set up symbols and caching for the rather slow
62
- `findReferences` function. Even more so for multiple projects/workspaces.
63
-
64
- There are two cases that enforce Knip to install the LS:
65
-
66
- ### 1. Class members
67
-
68
- The `findReferences` function is used to find unused members of imported classes
69
- (i.e. when the issue type `classMembers` is included).
70
-
71
- ### 2. Include external type definitions
72
-
73
- When [`--include-libs`][3] is enabled, Knip loads type definitions of external
74
- dependencies. This will also install the LS to access its `findReferences`
75
- function. It acts as an extra line of defense: only exports that Knip thinks
76
- aren't referenced (during the default/fast procedure), will now receive a second
77
- opinion from `findReferences`.
78
-
79
26
  ## Metrics
80
27
 
81
- Use [the `--performance` flag][4] to see how many times potentially expensive
28
+ Use [the `--performance` flag][2] to see how many times potentially expensive
82
29
  functions (e.g. `findReferences`) are invoked and how much time is spent in
83
30
  those functions. Example usage:
84
31
 
85
32
  ```sh
86
- knip --include classMembers --performance
33
+ knip --performance
87
34
  ```
88
35
 
89
36
  ## ignoreExportsUsedInFile
90
37
 
91
- The [ignoreExportsUsedInFile][5] option slows down the process slightly.
38
+ The [ignoreExportsUsedInFile][3] option slows down the process slightly.
92
39
  Typically, anywhere between 0.25% and 10% of total running time. To find out:
93
40
 
94
41
  ```sh
@@ -98,11 +45,9 @@ knip --performance-fn hasRefsInFile
98
45
  ## A last resort
99
46
 
100
47
  In case Knip is unbearably slow (or even crashes), you could resort to [lint
101
- individual workspaces][6].
48
+ individual workspaces][4].
102
49
 
103
50
  [1]: ./configuring-project-files.md
104
- [2]: ../reference/cli.md#--isolate-workspaces
105
- [3]: ../guides/handling-issues.mdx#external-libraries
106
- [4]: ../reference/cli.md#--performance
107
- [5]: ../reference/configuration.md#ignoreexportsusedinfile
108
- [6]: ../features/monorepos-and-workspaces.md#filter-workspaces
51
+ [2]: ../reference/cli.md#--performance
52
+ [3]: ../reference/configuration.md#ignoreexportsusedinfile
53
+ [4]: ../features/monorepos-and-workspaces.md#filter-workspaces
@@ -3,7 +3,7 @@ title: Declutter your JavaScript & TypeScript projects
3
3
  description: Project linter to find unused dependencies, exports and files
4
4
  template: splash
5
5
  hero:
6
- title: Knip
6
+ title: Knip v6
7
7
  tagline: Declutter your JavaScript & TypeScript projects
8
8
  image:
9
9
  file: ../../assets/logo.svg
@@ -12,8 +12,8 @@ hero:
12
12
  link: ./overview/getting-started
13
13
  icon: right-arrow
14
14
  variant: primary
15
- - text: 'NEW: Knip for Editors & Agents'
16
- link: /blog/for-editors-and-agents
15
+ - text: 'NEW: Knip v6'
16
+ link: /blog/knip-v6
17
17
  icon: rocket
18
18
  variant: secondary
19
19
  - text: View on GitHub
@@ -46,7 +46,7 @@ folder:
46
46
 
47
47
  ```json title="knip.json"
48
48
  {
49
- "$schema": "https://unpkg.com/knip@5/schema.json",
49
+ "$schema": "https://unpkg.com/knip@6/schema.json",
50
50
  "entry": ["src/index.ts", "scripts/{build,create}.js"],
51
51
  "project": ["src/**/*.ts", "scripts/**/*.js"]
52
52
  }