@knip/mcp 0.0.14 → 0.0.15
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 +2 -2
- package/src/docs/docs/blog/for-editors-and-agents.md +34 -30
- package/src/docs/docs/guides/configuring-project-files.md +1 -1
- package/src/docs/docs/guides/handling-issues.mdx +2 -2
- package/src/docs/docs/guides/troubleshooting.md +1 -1
- package/src/docs/docs/overview/features.md +2 -2
- package/src/docs/docs/overview/getting-started.mdx +16 -5
- package/src/docs/docs/reference/configuration.md +7 -0
- package/src/docs/docs/reference/faq.md +1 -2
- package/src/docs/docs/reference/known-issues.md +13 -8
- package/src/docs/docs/reference/plugins/angular.md +1 -1
- package/src/docs/docs/reference/plugins/astro-db.md +1 -1
- package/src/docs/docs/reference/plugins/astro.md +1 -1
- package/src/docs/docs/reference/plugins/ava.md +1 -1
- package/src/docs/docs/reference/plugins/babel.md +1 -1
- package/src/docs/docs/reference/plugins/biome.md +1 -1
- package/src/docs/docs/reference/plugins/bumpp.md +1 -1
- package/src/docs/docs/reference/plugins/c8.md +1 -1
- package/src/docs/docs/reference/plugins/capacitor.md +1 -1
- package/src/docs/docs/reference/plugins/changelogen.md +1 -1
- package/src/docs/docs/reference/plugins/changelogithub.md +1 -1
- package/src/docs/docs/reference/plugins/changesets.md +1 -1
- package/src/docs/docs/reference/plugins/commitizen.md +1 -1
- package/src/docs/docs/reference/plugins/commitlint.md +1 -1
- package/src/docs/docs/reference/plugins/convex.md +1 -1
- package/src/docs/docs/reference/plugins/create-typescript-app.md +1 -1
- package/src/docs/docs/reference/plugins/cspell.md +1 -1
- package/src/docs/docs/reference/plugins/cucumber.md +1 -1
- package/src/docs/docs/reference/plugins/cypress.md +1 -1
- package/src/docs/docs/reference/plugins/danger.md +1 -1
- package/src/docs/docs/reference/plugins/dependency-cruiser.md +2 -2
- package/src/docs/docs/reference/plugins/docusaurus.md +1 -1
- package/src/docs/docs/reference/plugins/dotenv.md +1 -1
- package/src/docs/docs/reference/plugins/drizzle.md +1 -1
- package/src/docs/docs/reference/plugins/eleventy.md +1 -1
- package/src/docs/docs/reference/plugins/eslint.md +2 -2
- package/src/docs/docs/reference/plugins/expo.md +1 -1
- package/src/docs/docs/reference/plugins/gatsby.md +1 -1
- package/src/docs/docs/reference/plugins/github-action.md +1 -1
- package/src/docs/docs/reference/plugins/github-actions.md +1 -1
- package/src/docs/docs/reference/plugins/glob.md +1 -1
- package/src/docs/docs/reference/plugins/graphql-codegen.md +1 -1
- package/src/docs/docs/reference/plugins/hardhat.md +1 -1
- package/src/docs/docs/reference/plugins/husky.md +1 -1
- package/src/docs/docs/reference/plugins/i18next-parser.md +2 -2
- package/src/docs/docs/reference/plugins/jest.md +2 -2
- package/src/docs/docs/reference/plugins/karma.md +1 -1
- package/src/docs/docs/reference/plugins/knex.md +37 -0
- package/src/docs/docs/reference/plugins/ladle.md +1 -1
- package/src/docs/docs/reference/plugins/lefthook.md +1 -1
- package/src/docs/docs/reference/plugins/lint-staged.md +1 -1
- package/src/docs/docs/reference/plugins/linthtml.md +1 -1
- package/src/docs/docs/reference/plugins/lockfile-lint.md +1 -1
- package/src/docs/docs/reference/plugins/lost-pixel.md +1 -1
- package/src/docs/docs/reference/plugins/markdownlint.md +1 -1
- package/src/docs/docs/reference/plugins/mdx.md +1 -1
- package/src/docs/docs/reference/plugins/mdxlint.md +1 -1
- package/src/docs/docs/reference/plugins/metro.md +1 -1
- package/src/docs/docs/reference/plugins/mocha.md +2 -2
- package/src/docs/docs/reference/plugins/moonrepo.md +1 -1
- package/src/docs/docs/reference/plugins/msw.md +1 -1
- package/src/docs/docs/reference/plugins/nano-staged.md +1 -1
- package/src/docs/docs/reference/plugins/nest.md +1 -1
- package/src/docs/docs/reference/plugins/netlify.md +1 -1
- package/src/docs/docs/reference/plugins/next-intl.md +1 -1
- package/src/docs/docs/reference/plugins/next-mdx.md +1 -1
- package/src/docs/docs/reference/plugins/next.md +1 -1
- package/src/docs/docs/reference/plugins/node-modules-inspector.md +2 -2
- package/src/docs/docs/reference/plugins/node.md +2 -2
- package/src/docs/docs/reference/plugins/nodemon.md +1 -1
- package/src/docs/docs/reference/plugins/npm-package-json-lint.md +1 -1
- package/src/docs/docs/reference/plugins/nuxt.md +1 -1
- package/src/docs/docs/reference/plugins/nx.md +3 -3
- package/src/docs/docs/reference/plugins/nyc.md +1 -1
- package/src/docs/docs/reference/plugins/oclif.md +1 -1
- package/src/docs/docs/reference/plugins/oxlint.md +2 -2
- package/src/docs/docs/reference/plugins/parcel.md +41 -0
- package/src/docs/docs/reference/plugins/playwright-ct.md +1 -1
- package/src/docs/docs/reference/plugins/playwright-test.md +1 -1
- package/src/docs/docs/reference/plugins/playwright.md +2 -2
- package/src/docs/docs/reference/plugins/plop.md +1 -1
- package/src/docs/docs/reference/plugins/pnpm.md +1 -1
- package/src/docs/docs/reference/plugins/postcss.md +1 -1
- package/src/docs/docs/reference/plugins/preconstruct.md +1 -1
- package/src/docs/docs/reference/plugins/prettier.md +1 -1
- package/src/docs/docs/reference/plugins/prisma.md +2 -2
- package/src/docs/docs/reference/plugins/react-cosmos.md +1 -1
- package/src/docs/docs/reference/plugins/react-router.md +1 -1
- package/src/docs/docs/reference/plugins/relay.md +2 -2
- package/src/docs/docs/reference/plugins/release-it.md +1 -1
- package/src/docs/docs/reference/plugins/remark.md +1 -1
- package/src/docs/docs/reference/plugins/remix.md +1 -1
- package/src/docs/docs/reference/plugins/rollup.md +2 -2
- package/src/docs/docs/reference/plugins/rsbuild.md +1 -1
- package/src/docs/docs/reference/plugins/rslib.md +1 -1
- package/src/docs/docs/reference/plugins/rspack.md +1 -1
- package/src/docs/docs/reference/plugins/rstest.md +1 -1
- package/src/docs/docs/reference/plugins/semantic-release.md +1 -1
- package/src/docs/docs/reference/plugins/sentry.md +1 -1
- package/src/docs/docs/reference/plugins/simple-git-hooks.md +1 -1
- package/src/docs/docs/reference/plugins/size-limit.md +1 -1
- package/src/docs/docs/reference/plugins/sst.md +1 -1
- package/src/docs/docs/reference/plugins/starlight.md +1 -1
- package/src/docs/docs/reference/plugins/storybook.md +1 -1
- package/src/docs/docs/reference/plugins/stryker.md +1 -1
- package/src/docs/docs/reference/plugins/stylelint.md +1 -1
- package/src/docs/docs/reference/plugins/svelte.md +1 -1
- package/src/docs/docs/reference/plugins/svgo.md +1 -1
- package/src/docs/docs/reference/plugins/svgr.md +1 -1
- package/src/docs/docs/reference/plugins/swc.md +1 -1
- package/src/docs/docs/reference/plugins/syncpack.md +1 -1
- package/src/docs/docs/reference/plugins/tailwind.md +1 -1
- package/src/docs/docs/reference/plugins/tanstack-router.md +49 -0
- package/src/docs/docs/reference/plugins/taskfile.md +1 -1
- package/src/docs/docs/reference/plugins/travis.md +1 -1
- package/src/docs/docs/reference/plugins/ts-node.md +1 -1
- package/src/docs/docs/reference/plugins/tsdown.md +2 -2
- package/src/docs/docs/reference/plugins/tsup.md +2 -2
- package/src/docs/docs/reference/plugins/tsx.md +2 -2
- package/src/docs/docs/reference/plugins/typedoc.md +2 -2
- package/src/docs/docs/reference/plugins/typescript.md +4 -3
- package/src/docs/docs/reference/plugins/unbuild.md +1 -1
- package/src/docs/docs/reference/plugins/unocss.md +1 -1
- package/src/docs/docs/reference/plugins/vercel-og.md +1 -1
- package/src/docs/docs/reference/plugins/vike.md +1 -1
- package/src/docs/docs/reference/plugins/vite.md +2 -2
- package/src/docs/docs/reference/plugins/vitepress.md +1 -1
- package/src/docs/docs/reference/plugins/vitest.md +2 -2
- package/src/docs/docs/reference/plugins/vue.md +1 -1
- package/src/docs/docs/reference/plugins/webdriver-io.md +1 -1
- package/src/docs/docs/reference/plugins/webpack.md +2 -2
- package/src/docs/docs/reference/plugins/wireit.md +1 -1
- package/src/docs/docs/reference/plugins/wrangler.md +1 -1
- package/src/docs/docs/reference/plugins/xo.md +1 -1
- package/src/docs/docs/reference/plugins/yarn.md +1 -1
- package/src/docs/docs/reference/plugins/yorkie.md +1 -1
- package/src/docs/docs/reference/plugins.md +5 -1
- package/src/docs/docs/writing-a-plugin/index.md +16 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knip/mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Knip MCP Server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
30
30
|
"zod": "^4.1.11",
|
|
31
|
-
"knip": "^5.80.
|
|
31
|
+
"knip": "^5.80.1"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=18.18.0"
|
|
@@ -30,8 +30,11 @@ with [3 key features][5]:
|
|
|
30
30
|
2. **Imports Tree View** for direct links to implementations
|
|
31
31
|
3. **Exports Tree View** for direct links to import & usage locations
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
The extension has a [built-in MCP Server][6] with a command and resources to
|
|
34
|
+
configure Knip for you, _completely automated_.
|
|
35
|
+
|
|
36
|
+
Find [Knip on the VS Code Marketplace][7] and find [Knip in the Open VSX
|
|
37
|
+
Registry][8].
|
|
35
38
|
|
|
36
39
|
## MCP Server
|
|
37
40
|
|
|
@@ -40,7 +43,7 @@ coding agent to "configure knip" and it will RTFM so you don't have to. Using a
|
|
|
40
43
|
newer model like Opus 4.5 or GPT 5.2 results in an optimized `knip.json` file
|
|
41
44
|
and an uncluttered codebase.
|
|
42
45
|
|
|
43
|
-
The [MCP Server is available][
|
|
46
|
+
The [MCP Server is available][9] separately and built into the VS Code
|
|
44
47
|
Extension.
|
|
45
48
|
|
|
46
49
|
## Language Server
|
|
@@ -52,25 +55,25 @@ information. Queries like "where is an export imported" or "is this import part
|
|
|
52
55
|
of a circular dependency" are just scratching the surface here.
|
|
53
56
|
|
|
54
57
|
Extensions for other IDEs can be built on top. See
|
|
55
|
-
[language-server/README.md][
|
|
58
|
+
[language-server/README.md][10]
|
|
56
59
|
|
|
57
60
|
## Screenshots
|
|
58
61
|
|
|
59
62
|
- [Lint Findings][4]
|
|
60
63
|
- [Imports & Exports][5]
|
|
61
|
-
- [Contention][
|
|
62
|
-
- [Circular Dependencies][
|
|
63
|
-
- [Conflicts][
|
|
64
|
-
- [Branching][
|
|
65
|
-
- [VS Code Extension Settings][
|
|
64
|
+
- [Contention][11]
|
|
65
|
+
- [Circular Dependencies][12]
|
|
66
|
+
- [Conflicts][13]
|
|
67
|
+
- [Branching][14]
|
|
68
|
+
- [VS Code Extension Settings][15]
|
|
66
69
|
|
|
67
70
|
### Lint Findings
|
|
68
71
|
|
|
69
|
-
![Lint Findings][
|
|
72
|
+
![Lint Findings][16]
|
|
70
73
|
|
|
71
74
|
### Imports & Exports
|
|
72
75
|
|
|
73
|
-
![hover][
|
|
76
|
+
![hover][17]
|
|
74
77
|
|
|
75
78
|
### Contention
|
|
76
79
|
|
|
@@ -82,7 +85,7 @@ branched/diamond-shaped import chains.
|
|
|
82
85
|
|
|
83
86
|
If an import is part of a circular dependency, Knip will display:
|
|
84
87
|
|
|
85
|
-
![Circular Dependencies][
|
|
88
|
+
![Circular Dependencies][18]
|
|
86
89
|
|
|
87
90
|
#### Conflicts
|
|
88
91
|
|
|
@@ -90,7 +93,7 @@ TypeScript shows direct conflicts when importing or re-exporting the same named
|
|
|
90
93
|
export from different files. Except when the problem is more subtle and the
|
|
91
94
|
chain spans more than one file. Knip warns:
|
|
92
95
|
|
|
93
|
-
![Conflicts][
|
|
96
|
+
![Conflicts][19]
|
|
94
97
|
|
|
95
98
|
#### Branching
|
|
96
99
|
|
|
@@ -98,30 +101,31 @@ Branched or diamond-shaped imports chains indicate unnecessary re-exports and
|
|
|
98
101
|
complexity. They help to untangle large codebases and shrink or get rid of
|
|
99
102
|
barrel files. Knip warns:
|
|
100
103
|
|
|
101
|
-
![Branching][
|
|
104
|
+
![Branching][20]
|
|
102
105
|
|
|
103
106
|
### VS Code Extension Settings
|
|
104
107
|
|
|
105
|
-
![VS Code Extension Settings][
|
|
108
|
+
![VS Code Extension Settings][21]
|
|
106
109
|
|
|
107
110
|
[1]: https://github.com/webpro-nl/knip/network/dependents
|
|
108
111
|
[2]: https://www.npmjs.com/package/knip
|
|
109
112
|
[3]: #editor-extension
|
|
110
113
|
[4]: #lint-findings
|
|
111
114
|
[5]: #imports--exports
|
|
112
|
-
[6]:
|
|
113
|
-
[7]: https://
|
|
114
|
-
[8]: https://
|
|
115
|
-
[9]:
|
|
115
|
+
[6]: #mcp-server
|
|
116
|
+
[7]: https://marketplace.visualstudio.com/items?itemName=webpro.vscode-knip
|
|
117
|
+
[8]: https://open-vsx.org/extension/webpro/vscode-knip
|
|
118
|
+
[9]: https://www.npmjs.com/package/@knip/mcp
|
|
119
|
+
[10]:
|
|
116
120
|
https://github.com/webpro-nl/knip/blob/main/packages/language-server/README.md
|
|
117
|
-
[
|
|
118
|
-
[
|
|
119
|
-
[
|
|
120
|
-
[
|
|
121
|
-
[
|
|
122
|
-
[
|
|
123
|
-
[
|
|
124
|
-
[
|
|
125
|
-
[
|
|
126
|
-
[
|
|
127
|
-
[
|
|
121
|
+
[11]: #contention
|
|
122
|
+
[12]: #circular-dependencies
|
|
123
|
+
[13]: #conflicts
|
|
124
|
+
[14]: #branching
|
|
125
|
+
[15]: #vs-code-extension-settings
|
|
126
|
+
[16]: /screenshots/editors-and-agents/diagnostics.webp
|
|
127
|
+
[17]: /screenshots/editors-and-agents/imports-exports.webp
|
|
128
|
+
[18]: /screenshots/editors-and-agents/circular-dependency.webp
|
|
129
|
+
[19]: /screenshots/editors-and-agents/conflict.webp
|
|
130
|
+
[20]: /screenshots/editors-and-agents/branch.webp
|
|
131
|
+
[21]: /screenshots/editors-and-agents/vscode-extension-settings.webp
|
|
@@ -200,6 +200,6 @@ automatically added as well.
|
|
|
200
200
|
|
|
201
201
|
[1]: ../typescript/unused-exports.md
|
|
202
202
|
[2]: ../explanations/entry-files.md
|
|
203
|
-
[3]: ../reference/configuration#ignoreexportsusedinfile
|
|
203
|
+
[3]: ../reference/configuration.md#ignoreexportsusedinfile
|
|
204
204
|
[4]: ../features/production-mode.md
|
|
205
205
|
[5]: ../explanations/plugins.md#entry-files
|
|
@@ -294,7 +294,7 @@ Some packages have the same name as a Node.js builtin (for instance `buffer` or
|
|
|
294
294
|
**Solution**: if Knip reports such a dependency as unused, add it to
|
|
295
295
|
[ignoreDependencies][22].
|
|
296
296
|
|
|
297
|
-
|
|
297
|
+
### Conditional or dynamic dependencies
|
|
298
298
|
|
|
299
299
|
Dependencies added conditionally in configuration files may not be detected by
|
|
300
300
|
Knip. This happens because Knip loads and executes config files, and conditional
|
|
@@ -586,7 +586,7 @@ To exclude false positives from the report, there are a few options:
|
|
|
586
586
|
- [Ignore exports used in file][47] for exports used internally.
|
|
587
587
|
- Individual exports can be [tagged using JSDoc syntax][48].
|
|
588
588
|
- Have the export in an entry file:
|
|
589
|
-
|
|
589
|
+
|
|
590
590
|
- Add the file to the `entry` file patterns array in the configuration.
|
|
591
591
|
- Move the export(s) to an entry file.
|
|
592
592
|
- Add the file to the `exports` field of `package.json`
|
|
@@ -121,7 +121,7 @@ to [open an issue on GitHub][14].
|
|
|
121
121
|
[2]: #exceptions-thrown-by-knip
|
|
122
122
|
[3]: #debug
|
|
123
123
|
[4]: #trace
|
|
124
|
-
[5]: ../guides/handling-issues.
|
|
124
|
+
[5]: ../guides/handling-issues.mdx
|
|
125
125
|
[6]: ./issue-reproduction.md
|
|
126
126
|
[7]: ../reference/known-issues.md
|
|
127
127
|
[8]: ../reference/cli.md#--workspace-dir
|
|
@@ -44,7 +44,7 @@ Also see [related tooling][2].
|
|
|
44
44
|
[4]: ../reference/cli.md#--cache
|
|
45
45
|
[5]: ../guides/working-with-commonjs.md
|
|
46
46
|
[6]: ../features/compilers.md
|
|
47
|
-
[7]: ../guides/troubleshooting.md#
|
|
47
|
+
[7]: ../guides/troubleshooting.md#debug
|
|
48
48
|
[8]: ../features/rules-and-filters.md#filters
|
|
49
49
|
[9]: ../features/auto-fix.mdx#format
|
|
50
50
|
[10]: ../reference/jsdoc-tsdoc-tags.md
|
|
@@ -63,4 +63,4 @@ Also see [related tooling][2].
|
|
|
63
63
|
[23]: ../features/production-mode.md#strict-mode
|
|
64
64
|
[24]: ../guides/troubleshooting.md#trace
|
|
65
65
|
[25]: ../reference/cli.md#--watch
|
|
66
|
-
[26]: ../features/monorepos-and-workspaces#lint-a-single-workspace
|
|
66
|
+
[26]: ../features/monorepos-and-workspaces.md#lint-a-single-workspace
|
|
@@ -77,7 +77,17 @@ If the output makes sense to you, feel free to go to the next page:
|
|
|
77
77
|
|
|
78
78
|
## Too Much?
|
|
79
79
|
|
|
80
|
-
In large or complex codebases the output might be overwhelming.
|
|
80
|
+
In large or complex codebases the output might be overwhelming.
|
|
81
|
+
|
|
82
|
+
:::tip[NEW]
|
|
83
|
+
|
|
84
|
+
Use the new [Knip Editor Extension][3] and let your coding agent configure Knip
|
|
85
|
+
for you. The built-in MCP Server will intelligently craft a custom `knip.json`
|
|
86
|
+
based on the documentation and configuration hints.
|
|
87
|
+
|
|
88
|
+
:::
|
|
89
|
+
|
|
90
|
+
Start by
|
|
81
91
|
limiting the number of shown issues per type:
|
|
82
92
|
|
|
83
93
|
<Tabs syncKey="pm">
|
|
@@ -108,12 +118,12 @@ limiting the number of shown issues per type:
|
|
|
108
118
|
|
|
109
119
|
The output is easier to digest and may include some configuration hints to get
|
|
110
120
|
an idea of what's left to configure. Many unused files? Go to [configuration][2]
|
|
111
|
-
and follow up with [troubleshooting][
|
|
121
|
+
and follow up with [troubleshooting][4] if needed.
|
|
112
122
|
|
|
113
123
|
:::tip
|
|
114
124
|
|
|
115
125
|
Do not use the `ignore` option just to get rid of unwanted output. Read
|
|
116
|
-
[Configuring Project Files][
|
|
126
|
+
[Configuring Project Files][5] to get the most out of Knip.
|
|
117
127
|
|
|
118
128
|
:::
|
|
119
129
|
|
|
@@ -191,5 +201,6 @@ already.
|
|
|
191
201
|
|
|
192
202
|
[1]: /playground
|
|
193
203
|
[2]: ./configuration.md
|
|
194
|
-
[3]: ../
|
|
195
|
-
[4]: ../guides/
|
|
204
|
+
[3]: ../blog/for-editors-and-agents.md
|
|
205
|
+
[4]: ../guides/troubleshooting.md
|
|
206
|
+
[5]: ../guides/configuring-project-files.md
|
|
@@ -180,6 +180,13 @@ notation below is valid and will report only exports tagged `@lintignore` or
|
|
|
180
180
|
}
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
+
:::caution
|
|
184
|
+
|
|
185
|
+
Tags must not contain hyphens or plus symbols, so it is recommended to stick to
|
|
186
|
+
letters and avoid snake-case.
|
|
187
|
+
|
|
188
|
+
:::
|
|
189
|
+
|
|
183
190
|
Also see [JSDoc & TSDoc Tags][8].
|
|
184
191
|
|
|
185
192
|
### `treatConfigHintsAsErrors`
|
|
@@ -408,7 +408,6 @@ Examples of features that have been requested include:
|
|
|
408
408
|
- Unused object members (and e.g. React component props)
|
|
409
409
|
- Unused object props in function return values
|
|
410
410
|
- Analyze workspaces in parallel
|
|
411
|
-
- Plugins for editors like VS Code and WebStorm (LSP-based?)
|
|
412
411
|
- Support Deno
|
|
413
412
|
- Improve internal code structures and accessibility to support contributions
|
|
414
413
|
- One-shot dead code removal (more comprehensive removal of unused variables,
|
|
@@ -427,7 +426,7 @@ require more development efforts and maintenance. Time is limited and
|
|
|
427
426
|
[5]: ../explanations/why-use-knip.md#comprehensive
|
|
428
427
|
[6]: #module-resolution
|
|
429
428
|
[7]: ../features/script-parser.md
|
|
430
|
-
[8]: ../guides/handling-issues.mdx#
|
|
429
|
+
[8]: ../guides/handling-issues.mdx#type-definition-packages
|
|
431
430
|
[9]: https://oxc.rs/docs/guide/usage/resolver.html
|
|
432
431
|
[10]: ../guides/performance.md#workspace-sharing
|
|
433
432
|
[11]: #whats-the-difference-between-workspaces-projects-and-programs
|
|
@@ -17,11 +17,13 @@ Error loading .../vite.config.ts
|
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Knip may load such files differently, in a different environment, with missing
|
|
20
|
-
environment variables, etcetera. Use `--debug` to locate
|
|
21
|
-
with more details.
|
|
20
|
+
environment variables, missing path aliases, etcetera. Use `--debug` to locate
|
|
21
|
+
the cause of the issue with more details.
|
|
22
22
|
|
|
23
23
|
Potential workarounds:
|
|
24
24
|
|
|
25
|
+
- [Set path aliases][2] for "Cannot find module" errors
|
|
26
|
+
- Set missing environment variable(s)
|
|
25
27
|
- Disable loading the file by overriding the default `config` for that plugin.
|
|
26
28
|
- Example: `vite: { config: [] }`
|
|
27
29
|
- In a monorepo, be more specific like so:
|
|
@@ -54,8 +56,10 @@ the configuration file.
|
|
|
54
56
|
Potential workarounds:
|
|
55
57
|
|
|
56
58
|
- Rewrite the import in the configuration file to a relative import.
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
+
- Inject support with a module like `tsx`: `NODE_OPTIONS="--import tsx" knip`
|
|
60
|
+
- Or `tsconfig-paths`: `NODE_OPTIONS="--import tsconfig-paths/register.js" knip`
|
|
61
|
+
- Use Bun with [knip-bun][3].
|
|
62
|
+
- See [exceptions from config files][4] for more potential workarounds.
|
|
59
63
|
|
|
60
64
|
## Nx Daemon
|
|
61
65
|
|
|
@@ -65,13 +69,14 @@ In Nx projects you might encounter this error:
|
|
|
65
69
|
NX Daemon process terminated and closed the connection
|
|
66
70
|
```
|
|
67
71
|
|
|
68
|
-
The solution is to [disable the Nx Daemon][
|
|
72
|
+
The solution is to [disable the Nx Daemon][5]:
|
|
69
73
|
|
|
70
74
|
```sh
|
|
71
75
|
NX_DAEMON=false knip
|
|
72
76
|
```
|
|
73
77
|
|
|
74
78
|
[1]: ../guides/handling-issues.mdx
|
|
75
|
-
[2]:
|
|
76
|
-
[3]: #
|
|
77
|
-
[4]:
|
|
79
|
+
[2]: #path-aliases-in-config-files
|
|
80
|
+
[3]: ./cli.md#knip-bun
|
|
81
|
+
[4]: #exceptions-from-config-files
|
|
82
|
+
[5]: https://nx.dev/concepts/nx-daemon#turning-it-off
|
|
@@ -24,6 +24,6 @@ The configuration was generated from source code. Also see [Script Parser][1].
|
|
|
24
24
|
|
|
25
25
|
This page was generated from the [c8 plugin source code][2].
|
|
26
26
|
|
|
27
|
-
[1]: ../../features/script-parser
|
|
27
|
+
[1]: ../../features/script-parser.md
|
|
28
28
|
[2]:
|
|
29
29
|
https://github.com/webpro-nl/knip/blob/main/packages/knip/src/plugins/c8/index.ts
|
|
@@ -39,6 +39,6 @@ options.
|
|
|
39
39
|
|
|
40
40
|
This page was generated from the [changelogithub plugin source code][2].
|
|
41
41
|
|
|
42
|
-
[1]: ../../explanations/plugins
|
|
42
|
+
[1]: ../../explanations/plugins.md
|
|
43
43
|
[2]:
|
|
44
44
|
https://github.com/webpro-nl/knip/blob/main/packages/knip/src/plugins/changelogithub/index.ts
|
|
@@ -32,6 +32,6 @@ options.
|
|
|
32
32
|
|
|
33
33
|
This page was generated from the [create-typescript-app plugin source code][2].
|
|
34
34
|
|
|
35
|
-
[1]: ../../explanations/plugins
|
|
35
|
+
[1]: ../../explanations/plugins.md
|
|
36
36
|
[2]:
|
|
37
37
|
https://github.com/webpro-nl/knip/blob/main/packages/knip/src/plugins/create-typescript-app/index.ts
|
|
@@ -43,7 +43,7 @@ The configuration was generated from source code. Also see [Script Parser][2].
|
|
|
43
43
|
|
|
44
44
|
This page was generated from the [dependency-cruiser plugin source code][3].
|
|
45
45
|
|
|
46
|
-
[1]: ../../explanations/plugins
|
|
47
|
-
[2]: ../../features/script-parser
|
|
46
|
+
[1]: ../../explanations/plugins.md
|
|
47
|
+
[2]: ../../features/script-parser.md
|
|
48
48
|
[3]:
|
|
49
49
|
https://github.com/webpro-nl/knip/blob/main/packages/knip/src/plugins/dependency-cruiser/index.ts
|
|
@@ -23,6 +23,6 @@ The configuration was generated from source code. Also see [Script Parser][1].
|
|
|
23
23
|
|
|
24
24
|
This page was generated from the [dotenv plugin source code][2].
|
|
25
25
|
|
|
26
|
-
[1]: ../../features/script-parser
|
|
26
|
+
[1]: ../../features/script-parser.md
|
|
27
27
|
[2]:
|
|
28
28
|
https://github.com/webpro-nl/knip/blob/main/packages/knip/src/plugins/dotenv/index.ts
|
|
@@ -76,11 +76,11 @@ The configuration was generated from source code. Also see [Script Parser][5].
|
|
|
76
76
|
|
|
77
77
|
This page was generated from the [eslint plugin source code][6].
|
|
78
78
|
|
|
79
|
-
[1]: ../../explanations/plugins
|
|
79
|
+
[1]: ../../explanations/plugins.md
|
|
80
80
|
[2]: https://github.com/microsoft/rushstack/issues/4965
|
|
81
81
|
[3]: https://github.com/microsoft/rushstack/issues/5049
|
|
82
82
|
[4]:
|
|
83
83
|
https://eslint.org/docs/v8.x/use/configure/configuration-files#cascading-and-hierarchy
|
|
84
|
-
[5]: ../../features/script-parser
|
|
84
|
+
[5]: ../../features/script-parser.md
|
|
85
85
|
[6]:
|
|
86
86
|
https://github.com/webpro-nl/knip/blob/main/packages/knip/src/plugins/eslint/index.ts
|
|
@@ -32,6 +32,6 @@ options.
|
|
|
32
32
|
|
|
33
33
|
This page was generated from the [github-action plugin source code][2].
|
|
34
34
|
|
|
35
|
-
[1]: ../../explanations/plugins
|
|
35
|
+
[1]: ../../explanations/plugins.md
|
|
36
36
|
[2]:
|
|
37
37
|
https://github.com/webpro-nl/knip/blob/main/packages/knip/src/plugins/github-action/index.ts
|
|
@@ -32,6 +32,6 @@ options.
|
|
|
32
32
|
|
|
33
33
|
This page was generated from the [github-actions plugin source code][2].
|
|
34
34
|
|
|
35
|
-
[1]: ../../explanations/plugins
|
|
35
|
+
[1]: ../../explanations/plugins.md
|
|
36
36
|
[2]:
|
|
37
37
|
https://github.com/webpro-nl/knip/blob/main/packages/knip/src/plugins/github-actions/index.ts
|
|
@@ -25,6 +25,6 @@ The configuration was generated from source code. Also see [Script Parser][1].
|
|
|
25
25
|
|
|
26
26
|
This page was generated from the [glob plugin source code][2].
|
|
27
27
|
|
|
28
|
-
[1]: ../../features/script-parser
|
|
28
|
+
[1]: ../../features/script-parser.md
|
|
29
29
|
[2]:
|
|
30
30
|
https://github.com/webpro-nl/knip/blob/main/packages/knip/src/plugins/glob/index.ts
|
|
@@ -44,6 +44,6 @@ options.
|
|
|
44
44
|
|
|
45
45
|
This page was generated from the [graphql-codegen plugin source code][2].
|
|
46
46
|
|
|
47
|
-
[1]: ../../explanations/plugins
|
|
47
|
+
[1]: ../../explanations/plugins.md
|
|
48
48
|
[2]:
|
|
49
49
|
https://github.com/webpro-nl/knip/blob/main/packages/knip/src/plugins/graphql-codegen/index.ts
|