@knip/mcp 0.0.18 → 0.0.19
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 +4 -4
- package/src/docs/blog/for-editors-and-agents.md +47 -43
- package/src/docs/blog/knip-v4.mdx +2 -2
- package/src/docs/blog/two-years.mdx +1 -1
- package/src/docs/docs/explanations/comparison-and-migration.md +4 -0
- package/src/docs/docs/explanations/plugins.md +20 -2
- package/src/docs/docs/features/auto-fix.mdx +2 -2
- package/src/docs/docs/guides/issue-reproduction.md +7 -6
- package/src/docs/docs/reference/faq.md +1 -3
- package/src/docs/explanations/comparison-and-migration.md +2 -0
- package/src/docs/explanations/plugins.md +16 -6
- package/src/docs/features/auto-fix.mdx +20 -5
- package/src/docs/features/monorepos-and-workspaces.md +19 -4
- package/src/docs/features/production-mode.md +1 -1
- package/src/docs/features/reporters.md +9 -7
- package/src/docs/guides/configuring-project-files.md +13 -13
- package/src/docs/guides/contributing.md +1 -1
- package/src/docs/guides/handling-issues.mdx +183 -121
- package/src/docs/guides/issue-reproduction.md +15 -7
- package/src/docs/guides/performance.md +19 -8
- package/src/docs/guides/troubleshooting.md +7 -10
- package/src/docs/guides/using-knip-in-ci.md +16 -20
- package/src/docs/index.mdx +3 -3
- package/src/docs/overview/configuration.md +6 -6
- package/src/docs/overview/features.md +5 -5
- package/src/docs/overview/getting-started.mdx +15 -5
- package/src/docs/reference/cli.md +269 -243
- package/src/docs/reference/configuration-hints.md +146 -0
- package/src/docs/reference/configuration.md +24 -7
- package/src/docs/reference/faq.md +28 -39
- package/src/docs/reference/integrations.md +105 -0
- package/src/docs/reference/known-issues.md +43 -21
- package/src/docs/reference/plugins.md +9 -1
- package/src/docs/reference/related-tooling.md +3 -3
- package/src/docs/sponsors.mdx +3 -4
- package/src/docs/typescript/unused-exports.md +1 -1
- package/src/docs/writing-a-plugin/index.md +16 -3
- package/src/tools.js +3 -9
- package/src/docs/docs/reference/plugins/angular.md +0 -33
- package/src/docs/docs/reference/plugins/astro-db.md +0 -34
- package/src/docs/docs/reference/plugins/astro-og-canvas.md +0 -13
- package/src/docs/docs/reference/plugins/astro.md +0 -43
- package/src/docs/docs/reference/plugins/ava.md +0 -46
- package/src/docs/docs/reference/plugins/babel.md +0 -38
- package/src/docs/docs/reference/plugins/biome.md +0 -34
- package/src/docs/docs/reference/plugins/bumpp.md +0 -38
- package/src/docs/docs/reference/plugins/bun.md +0 -13
- package/src/docs/docs/reference/plugins/c8.md +0 -26
- package/src/docs/docs/reference/plugins/capacitor.md +0 -35
- package/src/docs/docs/reference/plugins/changelogen.md +0 -38
- package/src/docs/docs/reference/plugins/changelogithub.md +0 -38
- package/src/docs/docs/reference/plugins/changesets.md +0 -33
- package/src/docs/docs/reference/plugins/commitizen.md +0 -35
- package/src/docs/docs/reference/plugins/commitlint.md +0 -39
- package/src/docs/docs/reference/plugins/convex.md +0 -34
- package/src/docs/docs/reference/plugins/create-typescript-app.md +0 -33
- package/src/docs/docs/reference/plugins/cspell.md +0 -36
- package/src/docs/docs/reference/plugins/cucumber.md +0 -36
- package/src/docs/docs/reference/plugins/cypress.md +0 -40
- package/src/docs/docs/reference/plugins/danger.md +0 -33
- package/src/docs/docs/reference/plugins/dependency-cruiser.md +0 -44
- package/src/docs/docs/reference/plugins/docusaurus.md +0 -39
- package/src/docs/docs/reference/plugins/dotenv.md +0 -24
- package/src/docs/docs/reference/plugins/drizzle.md +0 -33
- package/src/docs/docs/reference/plugins/eleventy.md +0 -38
- package/src/docs/docs/reference/plugins/eslint.md +0 -74
- package/src/docs/docs/reference/plugins/expo.md +0 -38
- package/src/docs/docs/reference/plugins/expressive-code.md +0 -39
- package/src/docs/docs/reference/plugins/gatsby.md +0 -46
- package/src/docs/docs/reference/plugins/github-action.md +0 -33
- package/src/docs/docs/reference/plugins/github-actions.md +0 -34
- package/src/docs/docs/reference/plugins/glob.md +0 -26
- package/src/docs/docs/reference/plugins/graphql-codegen.md +0 -43
- package/src/docs/docs/reference/plugins/hardhat.md +0 -33
- package/src/docs/docs/reference/plugins/husky.md +0 -37
- package/src/docs/docs/reference/plugins/i18next-parser.md +0 -44
- package/src/docs/docs/reference/plugins/jest.md +0 -50
- package/src/docs/docs/reference/plugins/karma.md +0 -36
- package/src/docs/docs/reference/plugins/knex.md +0 -33
- package/src/docs/docs/reference/plugins/ladle.md +0 -40
- package/src/docs/docs/reference/plugins/lefthook.md +0 -43
- package/src/docs/docs/reference/plugins/lint-staged.md +0 -45
- package/src/docs/docs/reference/plugins/linthtml.md +0 -38
- package/src/docs/docs/reference/plugins/lockfile-lint.md +0 -38
- package/src/docs/docs/reference/plugins/lost-pixel.md +0 -33
- package/src/docs/docs/reference/plugins/markdownlint.md +0 -34
- package/src/docs/docs/reference/plugins/mdx.md +0 -37
- package/src/docs/docs/reference/plugins/mdxlint.md +0 -35
- package/src/docs/docs/reference/plugins/metro.md +0 -46
- package/src/docs/docs/reference/plugins/mocha.md +0 -48
- package/src/docs/docs/reference/plugins/moonrepo.md +0 -35
- package/src/docs/docs/reference/plugins/msw.md +0 -36
- package/src/docs/docs/reference/plugins/nano-staged.md +0 -36
- package/src/docs/docs/reference/plugins/nest.md +0 -38
- package/src/docs/docs/reference/plugins/netlify.md +0 -42
- package/src/docs/docs/reference/plugins/next-intl.md +0 -33
- package/src/docs/docs/reference/plugins/next-mdx.md +0 -36
- package/src/docs/docs/reference/plugins/next.md +0 -53
- package/src/docs/docs/reference/plugins/nitro.md +0 -50
- package/src/docs/docs/reference/plugins/node-modules-inspector.md +0 -45
- package/src/docs/docs/reference/plugins/node.md +0 -48
- package/src/docs/docs/reference/plugins/nodemon.md +0 -27
- package/src/docs/docs/reference/plugins/npm-package-json-lint.md +0 -38
- package/src/docs/docs/reference/plugins/nuxt.md +0 -49
- package/src/docs/docs/reference/plugins/nx.md +0 -57
- package/src/docs/docs/reference/plugins/nyc.md +0 -36
- package/src/docs/docs/reference/plugins/oclif.md +0 -33
- package/src/docs/docs/reference/plugins/oxlint.md +0 -44
- package/src/docs/docs/reference/plugins/parcel.md +0 -37
- package/src/docs/docs/reference/plugins/playwright-ct.md +0 -39
- package/src/docs/docs/reference/plugins/playwright-test.md +0 -26
- package/src/docs/docs/reference/plugins/playwright.md +0 -49
- package/src/docs/docs/reference/plugins/plop.md +0 -33
- package/src/docs/docs/reference/plugins/pnpm.md +0 -33
- package/src/docs/docs/reference/plugins/postcss.md +0 -43
- package/src/docs/docs/reference/plugins/preconstruct.md +0 -33
- package/src/docs/docs/reference/plugins/prettier.md +0 -36
- package/src/docs/docs/reference/plugins/prisma.md +0 -55
- package/src/docs/docs/reference/plugins/react-cosmos.md +0 -39
- package/src/docs/docs/reference/plugins/react-router.md +0 -34
- package/src/docs/docs/reference/plugins/relay.md +0 -52
- package/src/docs/docs/reference/plugins/release-it.md +0 -34
- package/src/docs/docs/reference/plugins/remark.md +0 -37
- package/src/docs/docs/reference/plugins/remix.md +0 -40
- package/src/docs/docs/reference/plugins/rollup.md +0 -47
- package/src/docs/docs/reference/plugins/rsbuild.md +0 -33
- package/src/docs/docs/reference/plugins/rslib.md +0 -33
- package/src/docs/docs/reference/plugins/rspack.md +0 -33
- package/src/docs/docs/reference/plugins/rstest.md +0 -33
- package/src/docs/docs/reference/plugins/semantic-release.md +0 -38
- package/src/docs/docs/reference/plugins/sentry.md +0 -35
- package/src/docs/docs/reference/plugins/simple-git-hooks.md +0 -35
- package/src/docs/docs/reference/plugins/size-limit.md +0 -35
- package/src/docs/docs/reference/plugins/sst.md +0 -33
- package/src/docs/docs/reference/plugins/starlight.md +0 -33
- package/src/docs/docs/reference/plugins/storybook.md +0 -44
- package/src/docs/docs/reference/plugins/stryker.md +0 -33
- package/src/docs/docs/reference/plugins/stylelint.md +0 -38
- package/src/docs/docs/reference/plugins/svelte.md +0 -34
- package/src/docs/docs/reference/plugins/sveltekit.md +0 -33
- package/src/docs/docs/reference/plugins/svgo.md +0 -37
- package/src/docs/docs/reference/plugins/svgr.md +0 -40
- package/src/docs/docs/reference/plugins/swc.md +0 -33
- package/src/docs/docs/reference/plugins/syncpack.md +0 -38
- package/src/docs/docs/reference/plugins/tailwind.md +0 -33
- package/src/docs/docs/reference/plugins/tanstack-router.md +0 -48
- package/src/docs/docs/reference/plugins/taskfile.md +0 -40
- package/src/docs/docs/reference/plugins/travis.md +0 -33
- package/src/docs/docs/reference/plugins/ts-node.md +0 -27
- package/src/docs/docs/reference/plugins/tsdown.md +0 -45
- package/src/docs/docs/reference/plugins/tsup.md +0 -45
- package/src/docs/docs/reference/plugins/tsx.md +0 -46
- package/src/docs/docs/reference/plugins/typedoc.md +0 -49
- package/src/docs/docs/reference/plugins/typescript.md +0 -50
- package/src/docs/docs/reference/plugins/unbuild.md +0 -33
- package/src/docs/docs/reference/plugins/unocss.md +0 -36
- package/src/docs/docs/reference/plugins/vercel-og.md +0 -38
- package/src/docs/docs/reference/plugins/vike.md +0 -34
- package/src/docs/docs/reference/plugins/vite.md +0 -48
- package/src/docs/docs/reference/plugins/vitepress.md +0 -34
- package/src/docs/docs/reference/plugins/vitest.md +0 -50
- package/src/docs/docs/reference/plugins/vue.md +0 -33
- package/src/docs/docs/reference/plugins/webdriver-io.md +0 -33
- package/src/docs/docs/reference/plugins/webpack.md +0 -48
- package/src/docs/docs/reference/plugins/wireit.md +0 -33
- package/src/docs/docs/reference/plugins/wrangler.md +0 -33
- package/src/docs/docs/reference/plugins/xo.md +0 -40
- package/src/docs/docs/reference/plugins/yarn.md +0 -33
- package/src/docs/docs/reference/plugins/yorkie.md +0 -33
- package/src/docs/reference/plugins/angular.md +0 -33
- package/src/docs/reference/plugins/astro-db.md +0 -34
- package/src/docs/reference/plugins/astro.md +0 -43
- package/src/docs/reference/plugins/ava.md +0 -46
- package/src/docs/reference/plugins/babel.md +0 -38
- package/src/docs/reference/plugins/biome.md +0 -34
- package/src/docs/reference/plugins/bumpp.md +0 -38
- package/src/docs/reference/plugins/bun.md +0 -33
- package/src/docs/reference/plugins/c8.md +0 -26
- package/src/docs/reference/plugins/capacitor.md +0 -35
- package/src/docs/reference/plugins/changelogen.md +0 -38
- package/src/docs/reference/plugins/changelogithub.md +0 -38
- package/src/docs/reference/plugins/changesets.md +0 -33
- package/src/docs/reference/plugins/commitizen.md +0 -35
- package/src/docs/reference/plugins/commitlint.md +0 -39
- package/src/docs/reference/plugins/convex.md +0 -34
- package/src/docs/reference/plugins/create-typescript-app.md +0 -33
- package/src/docs/reference/plugins/cspell.md +0 -36
- package/src/docs/reference/plugins/cucumber.md +0 -36
- package/src/docs/reference/plugins/cypress.md +0 -40
- package/src/docs/reference/plugins/danger.md +0 -33
- package/src/docs/reference/plugins/dependency-cruiser.md +0 -44
- package/src/docs/reference/plugins/docusaurus.md +0 -39
- package/src/docs/reference/plugins/dotenv.md +0 -24
- package/src/docs/reference/plugins/drizzle.md +0 -33
- package/src/docs/reference/plugins/eleventy.md +0 -38
- package/src/docs/reference/plugins/eslint.md +0 -74
- package/src/docs/reference/plugins/expo.md +0 -38
- package/src/docs/reference/plugins/gatsby.md +0 -46
- package/src/docs/reference/plugins/github-action.md +0 -33
- package/src/docs/reference/plugins/github-actions.md +0 -34
- package/src/docs/reference/plugins/glob.md +0 -26
- package/src/docs/reference/plugins/graphql-codegen.md +0 -43
- package/src/docs/reference/plugins/hardhat.md +0 -33
- package/src/docs/reference/plugins/husky.md +0 -37
- package/src/docs/reference/plugins/i18next-parser.md +0 -44
- package/src/docs/reference/plugins/jest.md +0 -50
- package/src/docs/reference/plugins/karma.md +0 -36
- package/src/docs/reference/plugins/ladle.md +0 -40
- package/src/docs/reference/plugins/lefthook.md +0 -43
- package/src/docs/reference/plugins/lint-staged.md +0 -45
- package/src/docs/reference/plugins/linthtml.md +0 -38
- package/src/docs/reference/plugins/lockfile-lint.md +0 -38
- package/src/docs/reference/plugins/lost-pixel.md +0 -33
- package/src/docs/reference/plugins/markdownlint.md +0 -34
- package/src/docs/reference/plugins/mdx.md +0 -37
- package/src/docs/reference/plugins/mdxlint.md +0 -35
- package/src/docs/reference/plugins/metro.md +0 -46
- package/src/docs/reference/plugins/mocha.md +0 -48
- package/src/docs/reference/plugins/moonrepo.md +0 -35
- package/src/docs/reference/plugins/msw.md +0 -36
- package/src/docs/reference/plugins/nano-staged.md +0 -36
- package/src/docs/reference/plugins/nest.md +0 -38
- package/src/docs/reference/plugins/netlify.md +0 -42
- package/src/docs/reference/plugins/next-intl.md +0 -33
- package/src/docs/reference/plugins/next-mdx.md +0 -36
- package/src/docs/reference/plugins/next.md +0 -53
- package/src/docs/reference/plugins/node-modules-inspector.md +0 -45
- package/src/docs/reference/plugins/node.md +0 -48
- package/src/docs/reference/plugins/nodemon.md +0 -27
- package/src/docs/reference/plugins/npm-package-json-lint.md +0 -38
- package/src/docs/reference/plugins/nuxt.md +0 -49
- package/src/docs/reference/plugins/nx.md +0 -57
- package/src/docs/reference/plugins/nyc.md +0 -36
- package/src/docs/reference/plugins/oclif.md +0 -33
- package/src/docs/reference/plugins/oxlint.md +0 -44
- package/src/docs/reference/plugins/playwright-ct.md +0 -39
- package/src/docs/reference/plugins/playwright-test.md +0 -26
- package/src/docs/reference/plugins/playwright.md +0 -49
- package/src/docs/reference/plugins/plop.md +0 -33
- package/src/docs/reference/plugins/pnpm.md +0 -33
- package/src/docs/reference/plugins/postcss.md +0 -43
- package/src/docs/reference/plugins/preconstruct.md +0 -33
- package/src/docs/reference/plugins/prettier.md +0 -36
- package/src/docs/reference/plugins/prisma.md +0 -55
- package/src/docs/reference/plugins/react-cosmos.md +0 -39
- package/src/docs/reference/plugins/react-router.md +0 -34
- package/src/docs/reference/plugins/relay.md +0 -52
- package/src/docs/reference/plugins/release-it.md +0 -34
- package/src/docs/reference/plugins/remark.md +0 -37
- package/src/docs/reference/plugins/remix.md +0 -40
- package/src/docs/reference/plugins/rollup.md +0 -47
- package/src/docs/reference/plugins/rsbuild.md +0 -33
- package/src/docs/reference/plugins/rslib.md +0 -33
- package/src/docs/reference/plugins/rspack.md +0 -33
- package/src/docs/reference/plugins/rstest.md +0 -33
- package/src/docs/reference/plugins/semantic-release.md +0 -38
- package/src/docs/reference/plugins/sentry.md +0 -35
- package/src/docs/reference/plugins/simple-git-hooks.md +0 -35
- package/src/docs/reference/plugins/size-limit.md +0 -36
- package/src/docs/reference/plugins/sst.md +0 -33
- package/src/docs/reference/plugins/starlight.md +0 -33
- package/src/docs/reference/plugins/storybook.md +0 -44
- package/src/docs/reference/plugins/stryker.md +0 -33
- package/src/docs/reference/plugins/stylelint.md +0 -38
- package/src/docs/reference/plugins/svelte.md +0 -37
- package/src/docs/reference/plugins/svgo.md +0 -37
- package/src/docs/reference/plugins/svgr.md +0 -40
- package/src/docs/reference/plugins/swc.md +0 -33
- package/src/docs/reference/plugins/syncpack.md +0 -38
- package/src/docs/reference/plugins/tailwind.md +0 -33
- package/src/docs/reference/plugins/taskfile.md +0 -34
- package/src/docs/reference/plugins/travis.md +0 -33
- package/src/docs/reference/plugins/ts-node.md +0 -27
- package/src/docs/reference/plugins/tsdown.md +0 -45
- package/src/docs/reference/plugins/tsup.md +0 -45
- package/src/docs/reference/plugins/tsx.md +0 -46
- package/src/docs/reference/plugins/typedoc.md +0 -49
- package/src/docs/reference/plugins/typescript.md +0 -50
- package/src/docs/reference/plugins/unbuild.md +0 -33
- package/src/docs/reference/plugins/unocss.md +0 -36
- package/src/docs/reference/plugins/vercel-og.md +0 -38
- package/src/docs/reference/plugins/vike.md +0 -34
- package/src/docs/reference/plugins/vite.md +0 -48
- package/src/docs/reference/plugins/vitest.md +0 -50
- package/src/docs/reference/plugins/vue.md +0 -33
- package/src/docs/reference/plugins/webdriver-io.md +0 -33
- package/src/docs/reference/plugins/webpack.md +0 -48
- package/src/docs/reference/plugins/wireit.md +0 -33
- package/src/docs/reference/plugins/wrangler.md +0 -33
- package/src/docs/reference/plugins/xo.md +0 -40
- package/src/docs/reference/plugins/yarn.md +0 -33
- package/src/docs/reference/plugins/yorkie.md +0 -33
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knip/mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "Knip MCP Server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
],
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
23
|
-
"url": "https://github.com/webpro-nl/knip",
|
|
23
|
+
"url": "git+https://github.com/webpro-nl/knip.git",
|
|
24
24
|
"directory": "packages/mcp-server"
|
|
25
25
|
},
|
|
26
26
|
"author": "Lars Kappert <lars@webpro.nl>",
|
|
27
27
|
"license": "ISC",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@modelcontextprotocol/sdk": "^1.25.
|
|
29
|
+
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
30
30
|
"zod": "^4.1.11",
|
|
31
|
-
"knip": "^5.
|
|
31
|
+
"knip": "^5.84.0"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=18.18.0"
|
|
@@ -7,32 +7,34 @@ sidebar:
|
|
|
7
7
|
|
|
8
8
|
_Published: 2025-12-17_
|
|
9
9
|
|
|
10
|
-
Three years in, Knip has
|
|
10
|
+
Three years in, Knip has found its place in [over 10.000 projects][1] and is
|
|
11
11
|
downloaded [over 18M times/month][2]. A long period of steady growth in usage
|
|
12
12
|
and stability allows Knip to become more accessible to more people. That's why
|
|
13
|
-
I'm excited and proud to introduce the brand new
|
|
14
|
-
Server. For humans and coding agents alike, Knip will help keep your
|
|
15
|
-
tidy.
|
|
13
|
+
I'm excited and proud to introduce the brand new [Editor Extension][3] **and**
|
|
14
|
+
MCP Server. For humans and coding agents alike, Knip will help keep your
|
|
15
|
+
codebases tidy.
|
|
16
16
|
|
|
17
17
|
Don't forget... Knip it before you ship it!
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Editor Extension
|
|
20
20
|
|
|
21
21
|
This one is for you.
|
|
22
22
|
|
|
23
|
-
[The usual suspects][
|
|
23
|
+
[The usual suspects][4] like red squiggles for unused exports are there. What
|
|
24
24
|
really moves the needle for DX with Knip's module graph is **navigation**. A
|
|
25
|
-
completely unique way to view & fly through codebases
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
completely unique way to view & fly through codebases. Connect the dots during
|
|
26
|
+
development and refactors, while keeping things in check. We're starting out
|
|
27
|
+
with [3 key features][5]:
|
|
28
28
|
|
|
29
29
|
1. **Hover over Export** for import & usage locations
|
|
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
|
-
|
|
33
|
+
The extension has a [built-in MCP Server][6] with a command and resources to
|
|
34
|
+
configure Knip for you, _completely automated_.
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
Find [Knip on the VS Code Marketplace][7] and find [Knip in the Open VSX
|
|
37
|
+
Registry][8].
|
|
36
38
|
|
|
37
39
|
## MCP Server
|
|
38
40
|
|
|
@@ -41,7 +43,7 @@ coding agent to "configure knip" and it will RTFM so you don't have to. Using a
|
|
|
41
43
|
newer model like Opus 4.5 or GPT 5.2 results in an optimized `knip.json` file
|
|
42
44
|
and an uncluttered codebase.
|
|
43
45
|
|
|
44
|
-
The [MCP Server is available][
|
|
46
|
+
The [MCP Server is available][9] separately and built into the VS Code
|
|
45
47
|
Extension.
|
|
46
48
|
|
|
47
49
|
## Language Server
|
|
@@ -53,25 +55,25 @@ information. Queries like "where is an export imported" or "is this import part
|
|
|
53
55
|
of a circular dependency" are just scratching the surface here.
|
|
54
56
|
|
|
55
57
|
Extensions for other IDEs can be built on top. See
|
|
56
|
-
[language-server/README.md][
|
|
58
|
+
[language-server/README.md][10]
|
|
57
59
|
|
|
58
60
|
## Screenshots
|
|
59
61
|
|
|
60
|
-
- [Lint Findings][
|
|
61
|
-
- [Imports & Exports][
|
|
62
|
-
- [Contention][
|
|
63
|
-
- [Circular Dependencies][
|
|
64
|
-
- [Conflicts][
|
|
65
|
-
- [Branching][
|
|
66
|
-
- [VS Code Extension Settings][
|
|
62
|
+
- [Lint Findings][4]
|
|
63
|
+
- [Imports & Exports][5]
|
|
64
|
+
- [Contention][11]
|
|
65
|
+
- [Circular Dependencies][12]
|
|
66
|
+
- [Conflicts][13]
|
|
67
|
+
- [Branching][14]
|
|
68
|
+
- [VS Code Extension Settings][15]
|
|
67
69
|
|
|
68
70
|
### Lint Findings
|
|
69
71
|
|
|
70
|
-
![Lint Findings][
|
|
72
|
+
![Lint Findings][16]
|
|
71
73
|
|
|
72
74
|
### Imports & Exports
|
|
73
75
|
|
|
74
|
-
![hover][
|
|
76
|
+
![hover][17]
|
|
75
77
|
|
|
76
78
|
### Contention
|
|
77
79
|
|
|
@@ -83,7 +85,7 @@ branched/diamond-shaped import chains.
|
|
|
83
85
|
|
|
84
86
|
If an import is part of a circular dependency, Knip will display:
|
|
85
87
|
|
|
86
|
-
![Circular Dependencies][
|
|
88
|
+
![Circular Dependencies][18]
|
|
87
89
|
|
|
88
90
|
#### Conflicts
|
|
89
91
|
|
|
@@ -91,7 +93,7 @@ TypeScript shows direct conflicts when importing or re-exporting the same named
|
|
|
91
93
|
export from different files. Except when the problem is more subtle and the
|
|
92
94
|
chain spans more than one file. Knip warns:
|
|
93
95
|
|
|
94
|
-
![Conflicts][
|
|
96
|
+
![Conflicts][19]
|
|
95
97
|
|
|
96
98
|
#### Branching
|
|
97
99
|
|
|
@@ -99,29 +101,31 @@ Branched or diamond-shaped imports chains indicate unnecessary re-exports and
|
|
|
99
101
|
complexity. They help to untangle large codebases and shrink or get rid of
|
|
100
102
|
barrel files. Knip warns:
|
|
101
103
|
|
|
102
|
-
![Branching][
|
|
104
|
+
![Branching][20]
|
|
103
105
|
|
|
104
106
|
### VS Code Extension Settings
|
|
105
107
|
|
|
106
|
-
![VS Code Extension Settings][
|
|
108
|
+
![VS Code Extension Settings][21]
|
|
107
109
|
|
|
108
110
|
[1]: https://github.com/webpro-nl/knip/network/dependents
|
|
109
111
|
[2]: https://www.npmjs.com/package/knip
|
|
110
|
-
[3]: #
|
|
111
|
-
[4]: #
|
|
112
|
-
[5]:
|
|
113
|
-
[6]:
|
|
114
|
-
[7]: https://
|
|
115
|
-
[8]:
|
|
112
|
+
[3]: #editor-extension
|
|
113
|
+
[4]: #lint-findings
|
|
114
|
+
[5]: #imports--exports
|
|
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
|
|
@@ -144,6 +144,6 @@ Remember, Knip it before you ship it! Have a great day ☀️
|
|
|
144
144
|
|
|
145
145
|
[1]: ./slim-down-to-speed-up.md
|
|
146
146
|
[2]: ../features/compilers.md
|
|
147
|
-
[3]: ../guides/issue-reproduction
|
|
147
|
+
[3]: ../guides/issue-reproduction.md
|
|
148
148
|
[4]: https://github.com/sponsors/webpro
|
|
149
|
-
[5]: ../reference/cli#--experimental-tags
|
|
149
|
+
[5]: ../reference/cli.md#--experimental-tags
|
|
@@ -101,7 +101,7 @@ Thanks to Joshua Goldberg for [emoji-blast][7]! 🎉
|
|
|
101
101
|
[1]: https://www.npmjs.com/package/exportman/v/0.0.1
|
|
102
102
|
[2]: /cow-with-orange-scissors-van-gogh-style.webp
|
|
103
103
|
[3]: https://github.com/webpro-nl/knip/releases/tag/5.31.0
|
|
104
|
-
[4]: ../features/auto-fix.
|
|
104
|
+
[4]: ../features/auto-fix.mdx
|
|
105
105
|
[5]: https://github.com/unjs/jiti
|
|
106
106
|
[6]: /sponsors
|
|
107
107
|
[7]: https://www.emojiblast.dev
|
|
@@ -36,6 +36,8 @@ depcheck
|
|
|
36
36
|
knip --dependencies
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
**Project status**: The project is archived and recommends Knip.
|
|
40
|
+
|
|
39
41
|
### unimported
|
|
40
42
|
|
|
41
43
|
> Find and fix dangling files and unused dependencies in your JavaScript
|
|
@@ -95,6 +97,8 @@ Use `knip --exports` to also include class and enum members.
|
|
|
95
97
|
on a single `tsconfig.json` file (`includes` and `excludes`) and requires no
|
|
96
98
|
configuration. It removes the `export` keyword or the whole export declaration.
|
|
97
99
|
|
|
100
|
+
**Project status**: The project is archived and recommends Knip.
|
|
101
|
+
|
|
98
102
|
## Related projects
|
|
99
103
|
|
|
100
104
|
Additional alternative and related projects include:
|
|
@@ -86,8 +86,8 @@ plugins contain `package.json` in the list of `config` files.
|
|
|
86
86
|
|
|
87
87
|
:::tip[Summary]
|
|
88
88
|
|
|
89
|
-
Plugins
|
|
90
|
-
|
|
89
|
+
Plugins load configuration files to find referenced dependencies, and determine
|
|
90
|
+
unused and unlisted dependencies.
|
|
91
91
|
|
|
92
92
|
:::
|
|
93
93
|
|
|
@@ -304,6 +304,23 @@ playwright test -c playwright.web.config.ts
|
|
|
304
304
|
|
|
305
305
|
Please see [script parser][10] for more details.
|
|
306
306
|
|
|
307
|
+
## Config File Location
|
|
308
|
+
|
|
309
|
+
If configuration files aren't in their default location and they are not
|
|
310
|
+
referenced through some script like `vite -c ./dir/vite.config.ts`, then make
|
|
311
|
+
sure to tell Knip about it. Two examples:
|
|
312
|
+
|
|
313
|
+
```json title="knip.jsonc"
|
|
314
|
+
{
|
|
315
|
+
"playwright": { "config": ["e2e/playwright.config.ts"] },
|
|
316
|
+
"vite": "packages/*/vite.config.ts" // shorthand without `config` and array notation
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
This is common in projects where a directory like `packages/lib` is not an
|
|
321
|
+
actual workspace with a `package.json` file. Also see [integrated monorepos][11]
|
|
322
|
+
for similar cases.
|
|
323
|
+
|
|
307
324
|
## Summary
|
|
308
325
|
|
|
309
326
|
:::tip[Summary]
|
|
@@ -327,3 +344,4 @@ Plugins are configured with two distinct types of files:
|
|
|
327
344
|
[8]: ../reference/plugins/vitest.md
|
|
328
345
|
[9]: ../guides/handling-issues.mdx#conditional-or-dynamic-dependencies
|
|
329
346
|
[10]: ../features/script-parser.md
|
|
347
|
+
[11]: ../features/integrated-monorepos.md
|
|
@@ -73,17 +73,17 @@ Other solutions to share a minimal and reproducible case may work well too,
|
|
|
73
73
|
including:
|
|
74
74
|
|
|
75
75
|
- A public repository on e.g. GitHub or GitLab.
|
|
76
|
-
- A
|
|
76
|
+
- A pull request with a new [test][9] and/or [fixture folder][10].
|
|
77
77
|
|
|
78
78
|
The goal is to have an easy and common understanding and reproduction. If you're
|
|
79
79
|
unable to create a reproduction using one of the methods described then please
|
|
80
|
-
clearly explain this in the issue or [contact me][
|
|
80
|
+
clearly explain this in the issue or [contact me][11].
|
|
81
81
|
|
|
82
82
|
## Pull Request
|
|
83
83
|
|
|
84
84
|
The optimal way is to add fixtures and failing tests to the Knip repository, and
|
|
85
85
|
open a pull request to discuss the issue! Also see [instructions for
|
|
86
|
-
development][
|
|
86
|
+
development][12].
|
|
87
87
|
|
|
88
88
|
[1]: https://github.com/webpro-nl/knip/issues?q=is%3Aissue
|
|
89
89
|
[2]: https://knip.dev/reference/known-issues
|
|
@@ -97,6 +97,7 @@ development][11].
|
|
|
97
97
|
https://stackblitz.com/github/webpro-nl/knip/tree/main/templates/issue-reproduction/monorepo
|
|
98
98
|
[7]: https://codesandbox.io
|
|
99
99
|
[8]: https://stackblitz.com
|
|
100
|
-
[9]: https://github.com/webpro-nl/knip/
|
|
101
|
-
[10]: https://github.com/webpro
|
|
102
|
-
[11]: https://github.com/webpro
|
|
100
|
+
[9]: https://github.com/webpro-nl/knip/blob/main/.github/DEVELOPMENT.md#tests
|
|
101
|
+
[10]: https://github.com/webpro-nl/knip/tree/main/packages/knip/fixtures
|
|
102
|
+
[11]: https://github.com/webpro
|
|
103
|
+
[12]: https://github.com/webpro-nl/knip/blob/main/.github/DEVELOPMENT.md
|
|
@@ -405,10 +405,8 @@ Examples of features that have been requested include:
|
|
|
405
405
|
- Analyze workspaces in parallel
|
|
406
406
|
- Support Deno
|
|
407
407
|
- Improve internal code structures and accessibility to support contributions
|
|
408
|
-
- One-shot dead code removal (more comprehensive removal of unused variables,
|
|
409
|
-
duplicate exports, dead code, etc).
|
|
410
408
|
- Replace dependencies for better performance and correctness, such as for shell
|
|
411
|
-
script parsing
|
|
409
|
+
script parsing and globbing with "unignores".
|
|
412
410
|
|
|
413
411
|
These are all interesting ideas, but most increase the API surface area, and all
|
|
414
412
|
require more development efforts and maintenance. Time is limited and
|
|
@@ -95,6 +95,8 @@ Use `knip --exports` to also include class and enum members.
|
|
|
95
95
|
on a single `tsconfig.json` file (`includes` and `excludes`) and requires no
|
|
96
96
|
configuration. It removes the `export` keyword or the whole export declaration.
|
|
97
97
|
|
|
98
|
+
**Project status**: The project is archived and recommends Knip.
|
|
99
|
+
|
|
98
100
|
## Related projects
|
|
99
101
|
|
|
100
102
|
Additional alternative and related projects include:
|
|
@@ -73,7 +73,7 @@ export default defineConfig({
|
|
|
73
73
|
});
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
The Vitest plugin reads this configuration and
|
|
76
|
+
The Vitest plugin reads this configuration and returns two dependencies:
|
|
77
77
|
|
|
78
78
|
- `@vitest/coverage-istanbul`
|
|
79
79
|
- `vitest-environment-happy-dom`
|
|
@@ -108,7 +108,7 @@ configured.
|
|
|
108
108
|
|
|
109
109
|
:::tip[Plugins result in less configuration]
|
|
110
110
|
|
|
111
|
-
Plugins uses entry file patterns as defined in
|
|
111
|
+
Plugins uses entry file patterns as defined in your configuration file of these
|
|
112
112
|
tools. So you don't need to repeat this in your Knip configuration.
|
|
113
113
|
|
|
114
114
|
:::
|
|
@@ -242,7 +242,8 @@ dependency.
|
|
|
242
242
|
|
|
243
243
|
:::tip[Summary]
|
|
244
244
|
|
|
245
|
-
|
|
245
|
+
In your config files, plugins can find additional entry files and also other
|
|
246
|
+
config files recursively.
|
|
246
247
|
|
|
247
248
|
:::
|
|
248
249
|
|
|
@@ -283,6 +284,14 @@ automatically added as `entry` files for Knip to **statically** resolve the
|
|
|
283
284
|
|
|
284
285
|
Additionally, `./setup-tests.ts` will be added as an `entry` file.
|
|
285
286
|
|
|
287
|
+
:::note
|
|
288
|
+
|
|
289
|
+
When plugins dynamically load configuration files, conditional dependencies may
|
|
290
|
+
not be detected if the condition evaluates differently during analysis. See
|
|
291
|
+
[conditional or dynamic dependencies][9] for details and workarounds.
|
|
292
|
+
|
|
293
|
+
:::
|
|
294
|
+
|
|
286
295
|
## Command-Line Arguments
|
|
287
296
|
|
|
288
297
|
Plugins may define the arguments where Knip should look for entry files,
|
|
@@ -293,7 +302,7 @@ node --loader tsx scripts/deploy.ts
|
|
|
293
302
|
playwright test -c playwright.web.config.ts
|
|
294
303
|
```
|
|
295
304
|
|
|
296
|
-
Please see [script parser][
|
|
305
|
+
Please see [script parser][10] for more details.
|
|
297
306
|
|
|
298
307
|
## Summary
|
|
299
308
|
|
|
@@ -309,11 +318,12 @@ Plugins are configured with two distinct types of files:
|
|
|
309
318
|
:::
|
|
310
319
|
|
|
311
320
|
[1]: ../reference/plugins.md
|
|
312
|
-
[2]: ../
|
|
321
|
+
[2]: ../writing-a-plugin/index.md
|
|
313
322
|
[3]: #configuration-files
|
|
314
323
|
[4]: #entry-files
|
|
315
324
|
[5]: #command-line-arguments
|
|
316
325
|
[6]: ./entry-files.md
|
|
317
326
|
[7]: ../reference/plugins/eslint.md
|
|
318
327
|
[8]: ../reference/plugins/vitest.md
|
|
319
|
-
[9]: ../
|
|
328
|
+
[9]: ../guides/handling-issues.mdx#conditional-or-dynamic-dependencies
|
|
329
|
+
[10]: ../features/script-parser.md
|
|
@@ -9,13 +9,13 @@ Run Knip as you normally would, and if the report looks good then run it again
|
|
|
9
9
|
with the `--fix` flag to let Knip automatically apply fixes. It fixes the
|
|
10
10
|
following [issue types][1]:
|
|
11
11
|
|
|
12
|
-
- Remove `export` keyword for unused exports and exported types
|
|
12
|
+
- Remove `export` keyword for unused exports, re-exports, and exported types
|
|
13
13
|
- Remove `export default` keywords for unused default exports
|
|
14
|
-
- Remove exports, re-exports and exported types
|
|
15
14
|
- Remove unused enum members
|
|
16
15
|
- Remove unused class members (disabled by default)
|
|
17
16
|
- Remove unused `dependencies` and `devDependencies` from `package.json`
|
|
18
17
|
- Remove unused files
|
|
18
|
+
- Remove unused catalog entries
|
|
19
19
|
|
|
20
20
|
:::caution
|
|
21
21
|
|
|
@@ -91,9 +91,9 @@ configuration in your project.
|
|
|
91
91
|
|
|
92
92
|
### 2. Unused variables
|
|
93
93
|
|
|
94
|
-
Use a tool like ESLint or Biome to find and remove unused variables
|
|
95
|
-
files. Even better, try [remove-unused-vars][3] to remove unused
|
|
96
|
-
within files.
|
|
94
|
+
Use a tool like ESLint or Biome to find and remove unused imports and variables
|
|
95
|
+
inside files. Even better, try [remove-unused-vars][3] to remove unused
|
|
96
|
+
variables within files.
|
|
97
97
|
|
|
98
98
|
This may result in more deleted code, and Knip may then find more unused code.
|
|
99
99
|
Rinse and repeat!
|
|
@@ -316,6 +316,20 @@ component are unused and will remove those.
|
|
|
316
316
|
|
|
317
317
|
Note that [`classMembers` aren't included by default][4].
|
|
318
318
|
|
|
319
|
+
### Catalog entries
|
|
320
|
+
|
|
321
|
+
Unused [catalog][5] entries are removed from `pnpm-workspace.yaml`:
|
|
322
|
+
|
|
323
|
+
```diff title="pnpm-workspace.yaml"
|
|
324
|
+
packages:
|
|
325
|
+
- 'packages/*'
|
|
326
|
+
catalog:
|
|
327
|
+
react: ^18.0.0
|
|
328
|
+
- unused-package: ^1.0.0
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
Catalogs in `package.json` are supported as well.
|
|
332
|
+
|
|
319
333
|
## What's not included
|
|
320
334
|
|
|
321
335
|
Operations that auto-fix does not (yet) perform and why:
|
|
@@ -331,3 +345,4 @@ Operations that auto-fix does not (yet) perform and why:
|
|
|
331
345
|
[2]: https://github.com/JoshuaKGoldberg/formatly
|
|
332
346
|
[3]: https://github.com/webpro-nl/remove-unused-vars
|
|
333
347
|
[4]: ../guides/handling-issues.mdx#class-members
|
|
348
|
+
[5]: https://pnpm.io/catalogs
|
|
@@ -100,16 +100,31 @@ The following options are available inside workspace configurations:
|
|
|
100
100
|
Use `--debug` for verbose output and see the workspaces Knip includes, their
|
|
101
101
|
configurations, enabled plugins, glob options and resolved files.
|
|
102
102
|
|
|
103
|
-
##
|
|
103
|
+
## Filter workspaces
|
|
104
104
|
|
|
105
|
-
Use the `--workspace` (or `-W`) argument to
|
|
106
|
-
Knip run faster). Example:
|
|
105
|
+
Use the `--workspace` (or `-W`) argument to select one or more workspaces:
|
|
107
106
|
|
|
108
107
|
```sh
|
|
109
108
|
knip --workspace packages/my-lib
|
|
110
109
|
```
|
|
111
110
|
|
|
112
|
-
|
|
111
|
+
The filter supports multiple formats:
|
|
112
|
+
|
|
113
|
+
```sh
|
|
114
|
+
knip --workspace @myorg/my-lib # Package name
|
|
115
|
+
knip --workspace '@myorg/*' # Package name glob
|
|
116
|
+
knip --workspace packages/my-lib # Directory path
|
|
117
|
+
knip --workspace './apps/*' # Directory glob
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Combine selectors to include or exclude workspaces:
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
knip --workspace @myorg/* --workspace '!@myorg/legacy'
|
|
124
|
+
knip --workspace './apps/*' --workspace '@shared/utils'
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
This will include the target workspace(s), but also ancestor and dependent
|
|
113
128
|
workspaces. For two reasons:
|
|
114
129
|
|
|
115
130
|
- Ancestor workspaces may list dependencies in `package.json` the linted
|
|
@@ -37,7 +37,7 @@ Here's what's included in production mode:
|
|
|
37
37
|
- Only `entry` and `project` patterns suffixed with `!`
|
|
38
38
|
- Only production `entry` file patterns exported by plugins (such as Next.js and
|
|
39
39
|
Remix)
|
|
40
|
-
- Only the `start`
|
|
40
|
+
- Only the `start` script (of `package.json#scripts`)
|
|
41
41
|
- Ignore exports with the [`@internal` tag][1]
|
|
42
42
|
|
|
43
43
|
:::note
|
|
@@ -79,16 +79,18 @@ The keys match the [reported issue types][6]. Example usage:
|
|
|
79
79
|
knip --reporter json
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
###
|
|
83
|
-
|
|
84
|
-
TODO
|
|
82
|
+
### GitHub Actions
|
|
85
83
|
|
|
84
|
+
Use the GitHub Actions reporter in a workflow for annotations in pull requests.
|
|
86
85
|
Example usage:
|
|
87
86
|
|
|
88
87
|
```sh
|
|
89
88
|
knip --reporter github-actions
|
|
90
89
|
```
|
|
91
90
|
|
|
91
|
+
Changed files in pull requests will now contain inline annotations for lint
|
|
92
|
+
findings.
|
|
93
|
+
|
|
92
94
|
### Markdown
|
|
93
95
|
|
|
94
96
|
The built-in `markdown` reporter output is meant to be saved to a Markdown file.
|
|
@@ -138,8 +140,8 @@ dangling.js
|
|
|
138
140
|
<summary>Unused dependencies (2)</summary>
|
|
139
141
|
|
|
140
142
|
```
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
my-package package.json:17:5
|
|
144
|
+
unused-dep package.json:20:5
|
|
143
145
|
```
|
|
144
146
|
|
|
145
147
|
</details>
|
|
@@ -162,8 +164,8 @@ dangling.js
|
|
|
162
164
|
<summary>Unused dependencies (2)</summary>
|
|
163
165
|
|
|
164
166
|
```
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
my-package package.json:17:5
|
|
168
|
+
unused-dep package.json:20:5
|
|
167
169
|
```
|
|
168
170
|
|
|
169
171
|
</details>
|
|
@@ -11,7 +11,7 @@ Knip faster:
|
|
|
11
11
|
- Start with defaults. Only add targeted `entry` overrides when needed.
|
|
12
12
|
- Use `project` patterns (with negations) to define the scope for Knip.
|
|
13
13
|
- Use production mode to exclude tests and other non-production files.
|
|
14
|
-
- Use `ignore` only to suppress issues in specific files
|
|
14
|
+
- Use `ignore` only to suppress issues in specific files; it does not exclude
|
|
15
15
|
files from analysis.
|
|
16
16
|
|
|
17
17
|
Let's dive in and expand on all of these.
|
|
@@ -41,7 +41,7 @@ and adjust `project` to fit your codebase.
|
|
|
41
41
|
Use negated `project` patterns to precisely include/exclude files for unused
|
|
42
42
|
files detection.
|
|
43
43
|
|
|
44
|
-
Use `ignore
|
|
44
|
+
Use `ignore*` to suppress specific issues in matching files; it does not exclude
|
|
45
45
|
files from analysis.
|
|
46
46
|
|
|
47
47
|
:::
|
|
@@ -87,12 +87,12 @@ positives)? Use negated `project` patterns:
|
|
|
87
87
|
}
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
Why is
|
|
90
|
+
Why this is better:
|
|
91
91
|
|
|
92
|
-
- `project` defines
|
|
93
|
-
|
|
92
|
+
- `project` defines what belongs to the codebase, so build outputs are excluded
|
|
93
|
+
from analysis and unused file detection
|
|
94
94
|
- `ignore` is for the few files that should be analyzed but contain exceptions
|
|
95
|
-
-
|
|
95
|
+
- Improves performance by analyzing fewer files
|
|
96
96
|
|
|
97
97
|
## Ignore issues in specific files
|
|
98
98
|
|
|
@@ -127,8 +127,8 @@ instead.
|
|
|
127
127
|
}
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
Why not: `ignore`
|
|
131
|
-
|
|
130
|
+
Why not: `ignore` hides issues from the report; it does not exclude files from
|
|
131
|
+
analysis.
|
|
132
132
|
|
|
133
133
|
❌ Also don't do this:
|
|
134
134
|
|
|
@@ -138,8 +138,8 @@ from analysis.
|
|
|
138
138
|
}
|
|
139
139
|
```
|
|
140
140
|
|
|
141
|
-
Why not: plugins
|
|
142
|
-
|
|
141
|
+
Why not: plugins add test files as `entry` files; you can't and shouldn't
|
|
142
|
+
override that globally.
|
|
143
143
|
|
|
144
144
|
❌ Or this:
|
|
145
145
|
|
|
@@ -149,8 +149,8 @@ and shouldn't override that globally.
|
|
|
149
149
|
}
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
Why not: `project` is
|
|
153
|
-
|
|
152
|
+
Why not: `project` is for unused file detection; negating test files is
|
|
153
|
+
ineffective because they are `entry` files.
|
|
154
154
|
|
|
155
155
|
✅ Do this instead:
|
|
156
156
|
|
|
@@ -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
|
|
@@ -20,5 +20,5 @@ contributes to that goal is welcome!
|
|
|
20
20
|
[1]: https://github.com/webpro-nl/knip
|
|
21
21
|
[2]: ./issue-reproduction.md
|
|
22
22
|
[3]: https://github.com/webpro-nl/knip/blob/main/.github/CONTRIBUTING.md
|
|
23
|
-
[4]:
|
|
23
|
+
[4]: ../writing-a-plugin/index.md
|
|
24
24
|
[5]: https://github.com/webpro-nl/knip/blob/main/.github/DEVELOPMENT.md
|