@knip/mcp 0.0.18 → 0.0.20

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.
Files changed (343) hide show
  1. package/package.json +17 -17
  2. package/src/docs/blog/for-editors-and-agents.md +47 -43
  3. package/src/docs/blog/knip-v3.mdx +1 -1
  4. package/src/docs/blog/knip-v4.mdx +2 -2
  5. package/src/docs/blog/two-years.mdx +1 -1
  6. package/src/docs/explanations/comparison-and-migration.md +4 -0
  7. package/src/docs/explanations/plugins.md +38 -10
  8. package/src/docs/features/auto-fix.mdx +22 -7
  9. package/src/docs/features/monorepos-and-workspaces.md +19 -4
  10. package/src/docs/features/production-mode.md +1 -1
  11. package/src/docs/features/reporters.md +9 -7
  12. package/src/docs/guides/configuring-project-files.md +13 -13
  13. package/src/docs/guides/contributing.md +1 -1
  14. package/src/docs/guides/handling-issues.mdx +183 -121
  15. package/src/docs/guides/issue-reproduction.md +21 -12
  16. package/src/docs/guides/performance.md +19 -8
  17. package/src/docs/guides/troubleshooting.md +7 -10
  18. package/src/docs/guides/using-knip-in-ci.md +16 -20
  19. package/src/docs/index.mdx +3 -3
  20. package/src/docs/overview/configuration.md +6 -6
  21. package/src/docs/overview/features.md +5 -5
  22. package/src/docs/overview/getting-started.mdx +15 -5
  23. package/src/docs/reference/cli.md +269 -243
  24. package/src/docs/reference/configuration.md +24 -7
  25. package/src/docs/reference/faq.md +111 -59
  26. package/src/docs/reference/jsdoc-tsdoc-tags.md +12 -1
  27. package/src/docs/reference/known-issues.md +43 -21
  28. package/src/docs/reference/plugins.md +15 -1
  29. package/src/docs/reference/related-tooling.md +3 -3
  30. package/src/docs/sponsors.mdx +3 -4
  31. package/src/docs/typescript/unused-exports.md +1 -1
  32. package/src/docs/writing-a-plugin/index.md +17 -4
  33. package/src/tools.js +3 -9
  34. package/src/docs/docs/blog/brief-history.md +0 -30
  35. package/src/docs/docs/blog/for-editors-and-agents.md +0 -131
  36. package/src/docs/docs/blog/knip-v3.mdx +0 -88
  37. package/src/docs/docs/blog/knip-v4.mdx +0 -149
  38. package/src/docs/docs/blog/knip-v5.mdx +0 -190
  39. package/src/docs/docs/blog/migration-to-v1.md +0 -65
  40. package/src/docs/docs/blog/release-notes-v2.md +0 -46
  41. package/src/docs/docs/blog/slim-down-to-speed-up.md +0 -269
  42. package/src/docs/docs/blog/state-of-knip.md +0 -191
  43. package/src/docs/docs/blog/two-years.mdx +0 -107
  44. package/src/docs/docs/explanations/comparison-and-migration.md +0 -129
  45. package/src/docs/docs/explanations/entry-files.md +0 -70
  46. package/src/docs/docs/explanations/plugins.md +0 -329
  47. package/src/docs/docs/explanations/why-use-knip.md +0 -128
  48. package/src/docs/docs/features/auto-fix.mdx +0 -348
  49. package/src/docs/docs/features/compilers.md +0 -172
  50. package/src/docs/docs/features/integrated-monorepos.md +0 -61
  51. package/src/docs/docs/features/monorepos-and-workspaces.md +0 -149
  52. package/src/docs/docs/features/production-mode.md +0 -95
  53. package/src/docs/docs/features/reporters.md +0 -304
  54. package/src/docs/docs/features/rules-and-filters.md +0 -102
  55. package/src/docs/docs/features/script-parser.md +0 -156
  56. package/src/docs/docs/features/source-mapping.md +0 -100
  57. package/src/docs/docs/guides/configuring-project-files.md +0 -205
  58. package/src/docs/docs/guides/contributing.md +0 -24
  59. package/src/docs/docs/guides/handling-issues.mdx +0 -708
  60. package/src/docs/docs/guides/issue-reproduction.md +0 -102
  61. package/src/docs/docs/guides/namespace-imports.md +0 -125
  62. package/src/docs/docs/guides/performance.md +0 -108
  63. package/src/docs/docs/guides/troubleshooting.md +0 -133
  64. package/src/docs/docs/guides/using-knip-in-ci.md +0 -50
  65. package/src/docs/docs/guides/working-with-commonjs.md +0 -72
  66. package/src/docs/docs/index.mdx +0 -160
  67. package/src/docs/docs/overview/configuration.md +0 -104
  68. package/src/docs/docs/overview/features.md +0 -66
  69. package/src/docs/docs/overview/getting-started.mdx +0 -205
  70. package/src/docs/docs/overview/screenshots-videos.md +0 -42
  71. package/src/docs/docs/playground.mdx +0 -38
  72. package/src/docs/docs/reference/cli.md +0 -511
  73. package/src/docs/docs/reference/configuration.md +0 -430
  74. package/src/docs/docs/reference/dynamic-configuration.mdx +0 -72
  75. package/src/docs/docs/reference/faq.md +0 -432
  76. package/src/docs/docs/reference/issue-types.md +0 -43
  77. package/src/docs/docs/reference/jsdoc-tsdoc-tags.md +0 -122
  78. package/src/docs/docs/reference/known-issues.md +0 -86
  79. package/src/docs/docs/reference/plugins/.gitkeep +0 -0
  80. package/src/docs/docs/reference/plugins/angular.md +0 -33
  81. package/src/docs/docs/reference/plugins/astro-db.md +0 -34
  82. package/src/docs/docs/reference/plugins/astro-og-canvas.md +0 -13
  83. package/src/docs/docs/reference/plugins/astro.md +0 -43
  84. package/src/docs/docs/reference/plugins/ava.md +0 -46
  85. package/src/docs/docs/reference/plugins/babel.md +0 -38
  86. package/src/docs/docs/reference/plugins/biome.md +0 -34
  87. package/src/docs/docs/reference/plugins/bumpp.md +0 -38
  88. package/src/docs/docs/reference/plugins/bun.md +0 -13
  89. package/src/docs/docs/reference/plugins/c8.md +0 -26
  90. package/src/docs/docs/reference/plugins/capacitor.md +0 -35
  91. package/src/docs/docs/reference/plugins/changelogen.md +0 -38
  92. package/src/docs/docs/reference/plugins/changelogithub.md +0 -38
  93. package/src/docs/docs/reference/plugins/changesets.md +0 -33
  94. package/src/docs/docs/reference/plugins/commitizen.md +0 -35
  95. package/src/docs/docs/reference/plugins/commitlint.md +0 -39
  96. package/src/docs/docs/reference/plugins/convex.md +0 -34
  97. package/src/docs/docs/reference/plugins/create-typescript-app.md +0 -33
  98. package/src/docs/docs/reference/plugins/cspell.md +0 -36
  99. package/src/docs/docs/reference/plugins/cucumber.md +0 -36
  100. package/src/docs/docs/reference/plugins/cypress.md +0 -40
  101. package/src/docs/docs/reference/plugins/danger.md +0 -33
  102. package/src/docs/docs/reference/plugins/dependency-cruiser.md +0 -44
  103. package/src/docs/docs/reference/plugins/docusaurus.md +0 -39
  104. package/src/docs/docs/reference/plugins/dotenv.md +0 -24
  105. package/src/docs/docs/reference/plugins/drizzle.md +0 -33
  106. package/src/docs/docs/reference/plugins/eleventy.md +0 -38
  107. package/src/docs/docs/reference/plugins/eslint.md +0 -74
  108. package/src/docs/docs/reference/plugins/expo.md +0 -38
  109. package/src/docs/docs/reference/plugins/expressive-code.md +0 -39
  110. package/src/docs/docs/reference/plugins/gatsby.md +0 -46
  111. package/src/docs/docs/reference/plugins/github-action.md +0 -33
  112. package/src/docs/docs/reference/plugins/github-actions.md +0 -34
  113. package/src/docs/docs/reference/plugins/glob.md +0 -26
  114. package/src/docs/docs/reference/plugins/graphql-codegen.md +0 -43
  115. package/src/docs/docs/reference/plugins/hardhat.md +0 -33
  116. package/src/docs/docs/reference/plugins/husky.md +0 -37
  117. package/src/docs/docs/reference/plugins/i18next-parser.md +0 -44
  118. package/src/docs/docs/reference/plugins/jest.md +0 -50
  119. package/src/docs/docs/reference/plugins/karma.md +0 -36
  120. package/src/docs/docs/reference/plugins/knex.md +0 -33
  121. package/src/docs/docs/reference/plugins/ladle.md +0 -40
  122. package/src/docs/docs/reference/plugins/lefthook.md +0 -43
  123. package/src/docs/docs/reference/plugins/lint-staged.md +0 -45
  124. package/src/docs/docs/reference/plugins/linthtml.md +0 -38
  125. package/src/docs/docs/reference/plugins/lockfile-lint.md +0 -38
  126. package/src/docs/docs/reference/plugins/lost-pixel.md +0 -33
  127. package/src/docs/docs/reference/plugins/markdownlint.md +0 -34
  128. package/src/docs/docs/reference/plugins/mdx.md +0 -37
  129. package/src/docs/docs/reference/plugins/mdxlint.md +0 -35
  130. package/src/docs/docs/reference/plugins/metro.md +0 -46
  131. package/src/docs/docs/reference/plugins/mocha.md +0 -48
  132. package/src/docs/docs/reference/plugins/moonrepo.md +0 -35
  133. package/src/docs/docs/reference/plugins/msw.md +0 -36
  134. package/src/docs/docs/reference/plugins/nano-staged.md +0 -36
  135. package/src/docs/docs/reference/plugins/nest.md +0 -38
  136. package/src/docs/docs/reference/plugins/netlify.md +0 -42
  137. package/src/docs/docs/reference/plugins/next-intl.md +0 -33
  138. package/src/docs/docs/reference/plugins/next-mdx.md +0 -36
  139. package/src/docs/docs/reference/plugins/next.md +0 -53
  140. package/src/docs/docs/reference/plugins/nitro.md +0 -50
  141. package/src/docs/docs/reference/plugins/node-modules-inspector.md +0 -45
  142. package/src/docs/docs/reference/plugins/node.md +0 -48
  143. package/src/docs/docs/reference/plugins/nodemon.md +0 -27
  144. package/src/docs/docs/reference/plugins/npm-package-json-lint.md +0 -38
  145. package/src/docs/docs/reference/plugins/nuxt.md +0 -49
  146. package/src/docs/docs/reference/plugins/nx.md +0 -57
  147. package/src/docs/docs/reference/plugins/nyc.md +0 -36
  148. package/src/docs/docs/reference/plugins/oclif.md +0 -33
  149. package/src/docs/docs/reference/plugins/oxlint.md +0 -44
  150. package/src/docs/docs/reference/plugins/parcel.md +0 -37
  151. package/src/docs/docs/reference/plugins/playwright-ct.md +0 -39
  152. package/src/docs/docs/reference/plugins/playwright-test.md +0 -26
  153. package/src/docs/docs/reference/plugins/playwright.md +0 -49
  154. package/src/docs/docs/reference/plugins/plop.md +0 -33
  155. package/src/docs/docs/reference/plugins/pnpm.md +0 -33
  156. package/src/docs/docs/reference/plugins/postcss.md +0 -43
  157. package/src/docs/docs/reference/plugins/preconstruct.md +0 -33
  158. package/src/docs/docs/reference/plugins/prettier.md +0 -36
  159. package/src/docs/docs/reference/plugins/prisma.md +0 -55
  160. package/src/docs/docs/reference/plugins/react-cosmos.md +0 -39
  161. package/src/docs/docs/reference/plugins/react-router.md +0 -34
  162. package/src/docs/docs/reference/plugins/relay.md +0 -52
  163. package/src/docs/docs/reference/plugins/release-it.md +0 -34
  164. package/src/docs/docs/reference/plugins/remark.md +0 -37
  165. package/src/docs/docs/reference/plugins/remix.md +0 -40
  166. package/src/docs/docs/reference/plugins/rollup.md +0 -47
  167. package/src/docs/docs/reference/plugins/rsbuild.md +0 -33
  168. package/src/docs/docs/reference/plugins/rslib.md +0 -33
  169. package/src/docs/docs/reference/plugins/rspack.md +0 -33
  170. package/src/docs/docs/reference/plugins/rstest.md +0 -33
  171. package/src/docs/docs/reference/plugins/semantic-release.md +0 -38
  172. package/src/docs/docs/reference/plugins/sentry.md +0 -35
  173. package/src/docs/docs/reference/plugins/simple-git-hooks.md +0 -35
  174. package/src/docs/docs/reference/plugins/size-limit.md +0 -35
  175. package/src/docs/docs/reference/plugins/sst.md +0 -33
  176. package/src/docs/docs/reference/plugins/starlight.md +0 -33
  177. package/src/docs/docs/reference/plugins/storybook.md +0 -44
  178. package/src/docs/docs/reference/plugins/stryker.md +0 -33
  179. package/src/docs/docs/reference/plugins/stylelint.md +0 -38
  180. package/src/docs/docs/reference/plugins/svelte.md +0 -34
  181. package/src/docs/docs/reference/plugins/sveltekit.md +0 -33
  182. package/src/docs/docs/reference/plugins/svgo.md +0 -37
  183. package/src/docs/docs/reference/plugins/svgr.md +0 -40
  184. package/src/docs/docs/reference/plugins/swc.md +0 -33
  185. package/src/docs/docs/reference/plugins/syncpack.md +0 -38
  186. package/src/docs/docs/reference/plugins/tailwind.md +0 -33
  187. package/src/docs/docs/reference/plugins/tanstack-router.md +0 -48
  188. package/src/docs/docs/reference/plugins/taskfile.md +0 -40
  189. package/src/docs/docs/reference/plugins/travis.md +0 -33
  190. package/src/docs/docs/reference/plugins/ts-node.md +0 -27
  191. package/src/docs/docs/reference/plugins/tsdown.md +0 -45
  192. package/src/docs/docs/reference/plugins/tsup.md +0 -45
  193. package/src/docs/docs/reference/plugins/tsx.md +0 -46
  194. package/src/docs/docs/reference/plugins/typedoc.md +0 -49
  195. package/src/docs/docs/reference/plugins/typescript.md +0 -50
  196. package/src/docs/docs/reference/plugins/unbuild.md +0 -33
  197. package/src/docs/docs/reference/plugins/unocss.md +0 -36
  198. package/src/docs/docs/reference/plugins/vercel-og.md +0 -38
  199. package/src/docs/docs/reference/plugins/vike.md +0 -34
  200. package/src/docs/docs/reference/plugins/vite.md +0 -48
  201. package/src/docs/docs/reference/plugins/vitepress.md +0 -34
  202. package/src/docs/docs/reference/plugins/vitest.md +0 -50
  203. package/src/docs/docs/reference/plugins/vue.md +0 -33
  204. package/src/docs/docs/reference/plugins/webdriver-io.md +0 -33
  205. package/src/docs/docs/reference/plugins/webpack.md +0 -48
  206. package/src/docs/docs/reference/plugins/wireit.md +0 -33
  207. package/src/docs/docs/reference/plugins/wrangler.md +0 -33
  208. package/src/docs/docs/reference/plugins/xo.md +0 -40
  209. package/src/docs/docs/reference/plugins/yarn.md +0 -33
  210. package/src/docs/docs/reference/plugins/yorkie.md +0 -33
  211. package/src/docs/docs/reference/plugins.md +0 -140
  212. package/src/docs/docs/reference/related-tooling.md +0 -46
  213. package/src/docs/docs/sponsors.mdx +0 -64
  214. package/src/docs/docs/typescript/unused-dependencies.md +0 -86
  215. package/src/docs/docs/typescript/unused-exports.md +0 -87
  216. package/src/docs/docs/writing-a-plugin/argument-parsing.md +0 -202
  217. package/src/docs/docs/writing-a-plugin/index.md +0 -392
  218. package/src/docs/docs/writing-a-plugin/inputs.md +0 -162
  219. package/src/docs/reference/plugins/angular.md +0 -33
  220. package/src/docs/reference/plugins/astro-db.md +0 -34
  221. package/src/docs/reference/plugins/astro.md +0 -43
  222. package/src/docs/reference/plugins/ava.md +0 -46
  223. package/src/docs/reference/plugins/babel.md +0 -38
  224. package/src/docs/reference/plugins/biome.md +0 -34
  225. package/src/docs/reference/plugins/bumpp.md +0 -38
  226. package/src/docs/reference/plugins/bun.md +0 -33
  227. package/src/docs/reference/plugins/c8.md +0 -26
  228. package/src/docs/reference/plugins/capacitor.md +0 -35
  229. package/src/docs/reference/plugins/changelogen.md +0 -38
  230. package/src/docs/reference/plugins/changelogithub.md +0 -38
  231. package/src/docs/reference/plugins/changesets.md +0 -33
  232. package/src/docs/reference/plugins/commitizen.md +0 -35
  233. package/src/docs/reference/plugins/commitlint.md +0 -39
  234. package/src/docs/reference/plugins/convex.md +0 -34
  235. package/src/docs/reference/plugins/create-typescript-app.md +0 -33
  236. package/src/docs/reference/plugins/cspell.md +0 -36
  237. package/src/docs/reference/plugins/cucumber.md +0 -36
  238. package/src/docs/reference/plugins/cypress.md +0 -40
  239. package/src/docs/reference/plugins/danger.md +0 -33
  240. package/src/docs/reference/plugins/dependency-cruiser.md +0 -44
  241. package/src/docs/reference/plugins/docusaurus.md +0 -39
  242. package/src/docs/reference/plugins/dotenv.md +0 -24
  243. package/src/docs/reference/plugins/drizzle.md +0 -33
  244. package/src/docs/reference/plugins/eleventy.md +0 -38
  245. package/src/docs/reference/plugins/eslint.md +0 -74
  246. package/src/docs/reference/plugins/expo.md +0 -38
  247. package/src/docs/reference/plugins/gatsby.md +0 -46
  248. package/src/docs/reference/plugins/github-action.md +0 -33
  249. package/src/docs/reference/plugins/github-actions.md +0 -34
  250. package/src/docs/reference/plugins/glob.md +0 -26
  251. package/src/docs/reference/plugins/graphql-codegen.md +0 -43
  252. package/src/docs/reference/plugins/hardhat.md +0 -33
  253. package/src/docs/reference/plugins/husky.md +0 -37
  254. package/src/docs/reference/plugins/i18next-parser.md +0 -44
  255. package/src/docs/reference/plugins/jest.md +0 -50
  256. package/src/docs/reference/plugins/karma.md +0 -36
  257. package/src/docs/reference/plugins/ladle.md +0 -40
  258. package/src/docs/reference/plugins/lefthook.md +0 -43
  259. package/src/docs/reference/plugins/lint-staged.md +0 -45
  260. package/src/docs/reference/plugins/linthtml.md +0 -38
  261. package/src/docs/reference/plugins/lockfile-lint.md +0 -38
  262. package/src/docs/reference/plugins/lost-pixel.md +0 -33
  263. package/src/docs/reference/plugins/markdownlint.md +0 -34
  264. package/src/docs/reference/plugins/mdx.md +0 -37
  265. package/src/docs/reference/plugins/mdxlint.md +0 -35
  266. package/src/docs/reference/plugins/metro.md +0 -46
  267. package/src/docs/reference/plugins/mocha.md +0 -48
  268. package/src/docs/reference/plugins/moonrepo.md +0 -35
  269. package/src/docs/reference/plugins/msw.md +0 -36
  270. package/src/docs/reference/plugins/nano-staged.md +0 -36
  271. package/src/docs/reference/plugins/nest.md +0 -38
  272. package/src/docs/reference/plugins/netlify.md +0 -42
  273. package/src/docs/reference/plugins/next-intl.md +0 -33
  274. package/src/docs/reference/plugins/next-mdx.md +0 -36
  275. package/src/docs/reference/plugins/next.md +0 -53
  276. package/src/docs/reference/plugins/node-modules-inspector.md +0 -45
  277. package/src/docs/reference/plugins/node.md +0 -48
  278. package/src/docs/reference/plugins/nodemon.md +0 -27
  279. package/src/docs/reference/plugins/npm-package-json-lint.md +0 -38
  280. package/src/docs/reference/plugins/nuxt.md +0 -49
  281. package/src/docs/reference/plugins/nx.md +0 -57
  282. package/src/docs/reference/plugins/nyc.md +0 -36
  283. package/src/docs/reference/plugins/oclif.md +0 -33
  284. package/src/docs/reference/plugins/oxlint.md +0 -44
  285. package/src/docs/reference/plugins/playwright-ct.md +0 -39
  286. package/src/docs/reference/plugins/playwright-test.md +0 -26
  287. package/src/docs/reference/plugins/playwright.md +0 -49
  288. package/src/docs/reference/plugins/plop.md +0 -33
  289. package/src/docs/reference/plugins/pnpm.md +0 -33
  290. package/src/docs/reference/plugins/postcss.md +0 -43
  291. package/src/docs/reference/plugins/preconstruct.md +0 -33
  292. package/src/docs/reference/plugins/prettier.md +0 -36
  293. package/src/docs/reference/plugins/prisma.md +0 -55
  294. package/src/docs/reference/plugins/react-cosmos.md +0 -39
  295. package/src/docs/reference/plugins/react-router.md +0 -34
  296. package/src/docs/reference/plugins/relay.md +0 -52
  297. package/src/docs/reference/plugins/release-it.md +0 -34
  298. package/src/docs/reference/plugins/remark.md +0 -37
  299. package/src/docs/reference/plugins/remix.md +0 -40
  300. package/src/docs/reference/plugins/rollup.md +0 -47
  301. package/src/docs/reference/plugins/rsbuild.md +0 -33
  302. package/src/docs/reference/plugins/rslib.md +0 -33
  303. package/src/docs/reference/plugins/rspack.md +0 -33
  304. package/src/docs/reference/plugins/rstest.md +0 -33
  305. package/src/docs/reference/plugins/semantic-release.md +0 -38
  306. package/src/docs/reference/plugins/sentry.md +0 -35
  307. package/src/docs/reference/plugins/simple-git-hooks.md +0 -35
  308. package/src/docs/reference/plugins/size-limit.md +0 -36
  309. package/src/docs/reference/plugins/sst.md +0 -33
  310. package/src/docs/reference/plugins/starlight.md +0 -33
  311. package/src/docs/reference/plugins/storybook.md +0 -44
  312. package/src/docs/reference/plugins/stryker.md +0 -33
  313. package/src/docs/reference/plugins/stylelint.md +0 -38
  314. package/src/docs/reference/plugins/svelte.md +0 -37
  315. package/src/docs/reference/plugins/svgo.md +0 -37
  316. package/src/docs/reference/plugins/svgr.md +0 -40
  317. package/src/docs/reference/plugins/swc.md +0 -33
  318. package/src/docs/reference/plugins/syncpack.md +0 -38
  319. package/src/docs/reference/plugins/tailwind.md +0 -33
  320. package/src/docs/reference/plugins/taskfile.md +0 -34
  321. package/src/docs/reference/plugins/travis.md +0 -33
  322. package/src/docs/reference/plugins/ts-node.md +0 -27
  323. package/src/docs/reference/plugins/tsdown.md +0 -45
  324. package/src/docs/reference/plugins/tsup.md +0 -45
  325. package/src/docs/reference/plugins/tsx.md +0 -46
  326. package/src/docs/reference/plugins/typedoc.md +0 -49
  327. package/src/docs/reference/plugins/typescript.md +0 -50
  328. package/src/docs/reference/plugins/unbuild.md +0 -33
  329. package/src/docs/reference/plugins/unocss.md +0 -36
  330. package/src/docs/reference/plugins/vercel-og.md +0 -38
  331. package/src/docs/reference/plugins/vike.md +0 -34
  332. package/src/docs/reference/plugins/vite.md +0 -48
  333. package/src/docs/reference/plugins/vitest.md +0 -50
  334. package/src/docs/reference/plugins/vue.md +0 -33
  335. package/src/docs/reference/plugins/webdriver-io.md +0 -33
  336. package/src/docs/reference/plugins/webpack.md +0 -48
  337. package/src/docs/reference/plugins/wireit.md +0 -33
  338. package/src/docs/reference/plugins/wrangler.md +0 -33
  339. package/src/docs/reference/plugins/xo.md +0 -40
  340. package/src/docs/reference/plugins/yarn.md +0 -33
  341. package/src/docs/reference/plugins/yorkie.md +0 -33
  342. /package/src/docs/{docs/reference → reference}/configuration-hints.md +0 -0
  343. /package/src/docs/{docs/reference → reference}/integrations.md +0 -0
@@ -6,22 +6,24 @@ sidebar:
6
6
 
7
7
  import { Tabs, TabItem } from '@astrojs/starlight/components';
8
8
 
9
- A long report can be frustrating. The list may contain false positives, but also
10
- tons of useful information. To get the most value out of Knip, it may require
11
- some initial configuration.
9
+ Issues reported by Knip may contain false positives, but also tons of useful
10
+ information. Getting the most out of Knip may require some configuration.
12
11
 
13
- This guide helps you deal with false positives to find solutions and create the
14
- perfect report, with minimal configuration that will keep your project tidy.
15
-
16
- If you start out using Knip in a large project and have a long report, it makes
17
- sense to go over the issue types one by one. For instance, reducing the number
18
- of unused files will also reduce the number of unused dependencies.
12
+ Go over the issue types one by one. For instance, reducing the number of unused
13
+ files will also reduce the number of unused dependencies.
19
14
 
20
15
  1. [Unused files][1]
21
16
  2. [Unused dependencies][2]
22
17
  3. [Unresolved imports][3]
23
18
  4. [Unused exports][4]
24
19
 
20
+ :::tip
21
+
22
+ Try the [Knip Editor Extension][5]! Let your coding agent use the built-in
23
+ MCP Server and create a custom `knip.json` for you.
24
+
25
+ :::
26
+
25
27
  ## Unused files
26
28
 
27
29
  Getting the list of unused files right trickles down into the other issue types
@@ -32,22 +34,29 @@ of `project` files, but not in the set of files resolved from the `entry` files:
32
34
  unused files = project files - (entry files + resolved files)
33
35
  ```
34
36
 
35
- Let's go over common causes for unused files:
37
+ :::tip
38
+
39
+ Addressing reported [Configuration Hints][6] first might help significantly,
40
+ especially when handling unused files.
41
+
42
+ :::
36
43
 
37
- - [Missing generated files][5]
38
- - [Dynamic import specifiers][6]
39
- - [Unsupported arguments in scripts][7]
40
- - [Unsupported file formats][8]
41
- - [Missing plugin][9]
42
- - [Incomplete plugin][10]
43
- - [TypeScript path aliases in monorepos][11]
44
- - [Relative paths across workspaces][12]
45
- - [Integrated monorepos][13]
46
- - [Auto-mocking or auto-imports][14]
44
+ Common causes for unused files include:
45
+
46
+ - [Missing generated files][7]
47
+ - [Dynamic import specifiers][8]
48
+ - [Unsupported arguments in scripts][9]
49
+ - [Unsupported file formats][10]
50
+ - [Missing plugin][11]
51
+ - [Incomplete plugin][12]
52
+ - [TypeScript path aliases in monorepos][13]
53
+ - [Relative paths across workspaces][14]
54
+ - [Integrated monorepos][15]
55
+ - [Auto-mocking or auto-imports][16]
47
56
 
48
57
  In most cases you can add `entry` patterns manually.
49
58
 
50
- Use `--files` to [filter the report][15] and focus only on unused files:
59
+ Use `--files` to [filter the report][17] and focus only on unused files:
51
60
 
52
61
  ```sh
53
62
  knip --files
@@ -60,15 +69,15 @@ exports.
60
69
  :::caution
61
70
 
62
71
  Don't add unused files to the `ignore` option before reading [configuring
63
- project files][16]. Learn why and when to use `entry`, `project`, production
64
- mode and `ignore` patterns for better results and performance.
72
+ project files][18]. Learn why and when to use `entry`, `project`, production
73
+ mode and `ignore*` patterns for better results and performance.
65
74
 
66
75
  :::
67
76
 
68
77
  ### Missing generated files
69
78
 
70
79
  For certain features, Knip needs to run after relevant files are generated. For
71
- instance, [source mapping][17] in a monorepo may require files to be built into
80
+ instance, [source mapping][19] in a monorepo may require files to be built into
72
81
  `dist` folders first. And generated files in the `src` directory may import
73
82
  other files. For instance, the `src/routeTree.gen.ts` file generated by
74
83
  `@tanstack/router` must exist so Knip can find the imported route files.
@@ -106,7 +115,7 @@ Some tooling command arguments aren't recognized:
106
115
  **Solution**: add `production.ts` to `entry` patterns.
107
116
 
108
117
  This works the same for any script, also those in GitHub Actions workflows or
109
- Git hooks. See [script parser][18] for more details about Knip's script parser.
118
+ Git hooks. See [script parser][20] for more details about Knip's script parser.
110
119
 
111
120
  ### Unsupported file formats
112
121
 
@@ -123,9 +132,9 @@ Entry files referenced in HTML files (e.g. `<script src="production.js">`).
123
132
  **Solution**: add `production.js` to `entry` patterns. Or add an `.html`
124
133
  compiler to extract and resolve the value of `<script src>` elements.
125
134
 
126
- Knip has support for some popular framework formats through [compilers][19], and
127
- additional compilers can be added for for any file type. The recommended
128
- solution is usually to add the file as shown in each example as an `entry` file.
135
+ Knip has support for some popular framework formats through [compilers][21], and
136
+ additional compilers can be added for any file type. The recommended solution is
137
+ usually to add the file as shown in each example as an `entry` file.
129
138
 
130
139
  ### Missing plugin
131
140
 
@@ -139,16 +148,16 @@ examples:
139
148
  - A framework automatically imports all files matching `src/models/*.ts` → those
140
149
  files are reported as unused.
141
150
 
142
- **Solution**: [create a new plugin][20] for the tool or framework that's not [in
143
- the list][21] yet. Or work around it and add `entry` patterns and maybe ignore a
144
- dependency or two (using [`ignoreDependencies`][22]).
151
+ **Solution**: [create a new plugin][22] for the tool or framework that's not [in
152
+ the list][23] yet. Or work around it and add `entry` patterns and maybe ignore a
153
+ dependency or two (using [`ignoreDependencies`][24]).
145
154
 
146
155
  ### Incomplete plugin
147
156
 
148
157
  Files may be reported as unused if existing plugins do not include that entry
149
- file pattern yet. See the [plugins section of entry files][23] for more details.
158
+ file pattern yet. See the [plugins section of entry files][25] for more details.
150
159
 
151
- **Solution**: [override plugin configuration][24] to customize default patterns
160
+ **Solution**: [override plugin configuration][26] to customize default patterns
152
161
  for existing plugins. Or even better: send a pull request to improve the plugin.
153
162
 
154
163
  ### TypeScript path aliases in monorepos
@@ -184,7 +193,7 @@ Knip, it's better to be explicit and list other workspaces as dependencies in
184
193
  An additional benefit is that Knip will report unused and unlisted dependencies
185
194
  from now on.
186
195
 
187
- Also see [FAQ: Why can't I use path aliases to reference other workspaces?][25]
196
+ Also see [FAQ: Why can't I use path aliases to reference other workspaces?][27]
188
197
 
189
198
  ### Relative paths across workspaces
190
199
 
@@ -207,7 +216,7 @@ import { something } from '@org/common';
207
216
  An additional benefit is that Knip will report unused and unlisted dependencies
208
217
  from now on.
209
218
 
210
- Also see [TypeScript path aliases in monorepos][11].
219
+ Also see [TypeScript path aliases in monorepos][13].
211
220
 
212
221
  ### Integrated monorepos
213
222
 
@@ -215,7 +224,7 @@ Multiple instances of configuration files like `.eslintrc` and
215
224
  `jest.config.json` across the repository may be reported as unused when working
216
225
  in a (mono)repo with a single `package.json`.
217
226
 
218
- **Solution**: see [integrated monorepos][26] for more details and how to
227
+ **Solution**: see [integrated monorepos][28] for more details and how to
219
228
  configure plugins to target those configuration files.
220
229
 
221
230
  ### Auto-mocking or auto-imports
@@ -250,11 +259,12 @@ unused dependencies.
250
259
 
251
260
  The most common causes for unused dependencies include:
252
261
 
253
- - [Missing or incomplete plugins][27]
254
- - [Unrecognized references][28]
255
- - [Type Definition Packages][29]
262
+ - [Missing or incomplete plugins][29]
263
+ - [Unrecognized references][30]
264
+ - [Type Definition Packages][31]
265
+ - [Dependencies named after Node.js builtins][32]
256
266
 
257
- Use `--dependencies` to [filter the report][15] and focus only on issues related
267
+ Use `--dependencies` to [filter the report][17] and focus only on issues related
258
268
  to dependencies:
259
269
 
260
270
  ```sh
@@ -264,8 +274,8 @@ knip --dependencies
264
274
  :::caution[Monorepo]
265
275
 
266
276
  In a monorepo, a dependency is unused in the root workspace's `package.json` if
267
- it's also listed in an descendent workspace, and referenced only in the
268
- descendent workspace.
277
+ it's also listed in a descendant workspace, and referenced only in the
278
+ descendant workspace.
269
279
 
270
280
  :::
271
281
 
@@ -285,10 +295,57 @@ Sometimes a reference to a dependency is unrecognizable or unreachable to Knip,
285
295
  so it's a false positive and incorrectly reported as unused.
286
296
 
287
297
  **Solution**: add a new plugin or improve an existing one. If you don't feel
288
- like a plugin could solve it, a last resort is to use [ignoreDependencies][22].
298
+ like a plugin could solve it, a last resort is to use [ignoreDependencies][24].
289
299
 
290
300
  If a binary (or "executable") is referenced you'll want to use `ignoreBinaries`
291
- instead. See [unlisted binaries][30].
301
+ instead. See [unlisted binaries][33].
302
+
303
+ ### Dependencies named after Node.js builtins
304
+
305
+ Some packages have the same name as a Node.js builtin (for instance `buffer` or
306
+ `process`).
307
+
308
+ **Solution**: if Knip reports such a dependency as unused, add it to
309
+ [ignoreDependencies][24].
310
+
311
+ ### Conditional or dynamic dependencies
312
+
313
+ Dependencies added conditionally in configuration files may not be detected by
314
+ Knip. This happens because Knip loads and executes config files, and conditional
315
+ logic may evaluate differently during analysis.
316
+
317
+ For example, this Playwright configuration conditionally adds a reporter:
318
+
319
+ ```ts title="playwright.config.ts"
320
+ import { defineConfig } from '@playwright/test';
321
+
322
+ const reporters: any[] = [['list']];
323
+ if (process.env.REPORT_PORTAL_ENABLED) {
324
+ reporters.push(['@reportportal/agent-js-playwright', config]);
325
+ }
326
+
327
+ export default defineConfig({
328
+ reporter: reporters,
329
+ });
330
+ ```
331
+
332
+ If `process.env.REPORT_PORTAL_ENABLED` evaluates to `false` when Knip runs, the
333
+ `@reportportal/agent-js-playwright` dependency won't be detected and may be
334
+ reported as unused.
335
+
336
+ This limitation exists because Knip executes configuration files to parse their
337
+ exported value. While Knip can parse configuration files statically using AST
338
+ (Abstract Syntax Tree) analysis, this approach becomes complex very quickly and
339
+ most of the time it is easier to use the [`ignoreDependencies`][24]
340
+ configuration option for conditionals.
341
+
342
+ ```json title="knip.json"
343
+ {
344
+ "ignoreDependencies": ["@reportportal/agent-js-playwright"]
345
+ }
346
+ ```
347
+
348
+ This pattern can be applied to any plugin that loads configuration files.
292
349
 
293
350
  ### Type Definition Packages
294
351
 
@@ -317,7 +374,7 @@ In strict production mode, even when re-exported and part of the package's
317
374
  public API, Knip does not try to figure out what exactly are "production types"
318
375
  and expects those in `devDependencies`.
319
376
 
320
- **Solution**: list exceptions in [ignoreDependencies][22].
377
+ **Solution**: list exceptions in [ignoreDependencies][24].
321
378
 
322
379
  ### Unlisted dependencies
323
380
 
@@ -349,7 +406,7 @@ reported as an unlisted binary as there is no package that contains it.
349
406
 
350
407
  Binaries that are installed on the OS already and thus likely not meant to be
351
408
  installed from npm are not reported as unlisted (details: [list of ignored
352
- binaries in source][31]).
409
+ binaries in source][34]).
353
410
 
354
411
  #### Missing binaries
355
412
 
@@ -359,7 +416,7 @@ either the way your package manager installs dependencies and binaries, or by
359
416
  not running Knip from the root of the repository.
360
417
 
361
418
  **Solution**: run Knip from the project root. If needed, [lint workspaces
362
- individually][32].
419
+ individually][35].
363
420
 
364
421
  Sometimes binaries and how they're reported can be a bit confusing. See this
365
422
  example:
@@ -377,9 +434,9 @@ example:
377
434
  ```
378
435
 
379
436
  This example works fine without anything reported, as the `@commitlint/cli`
380
- package includes the `commitlint` binary. However, some script may contain
381
- `npx commitlint` and here Knip assumes `commitlint` is the name of the package.
382
- This technically works, as `commitlint` is a transitive dependency of
437
+ package includes the `commitlint` binary. However, some script may contain `npx
438
+ commitlint` and here Knip assumes `commitlint` is the name of the package. This
439
+ technically works, as `commitlint` is a transitive dependency of
383
440
  `@commitlint/cli`.
384
441
 
385
442
  **Solution**: use `npx @commitlint/cli`
@@ -395,10 +452,10 @@ or consider the binary and package(s) referenced, respectively.
395
452
  Knip may ignore or be unable to resolve an import specifier or dependency
396
453
  references. The most common causes for unresolved imports:
397
454
 
398
- - [Template strings][33]
399
- - [Extensionless imports][28]
400
- - [Unrecognized path aliases][34]
401
- - [External aliased imports][35]
455
+ - [Template strings][36]
456
+ - [Extensionless imports][30]
457
+ - [Unrecognized path aliases][37]
458
+ - [External aliased imports][38]
402
459
 
403
460
  ### Template strings
404
461
 
@@ -430,24 +487,24 @@ The first import is resolved properly, because `.vue` is a known extension if
430
487
  the Vue plugin is enabled. The second import might not be resolved, because
431
488
  `.svg` is not a known extension.
432
489
 
433
- The recommendation is to always add the extension when importing such files,
434
- similar to how standard ES Modules specifies file extensions are necessary.
490
+ **Solution**: include the extension. Hosts supporting ES Modules (e.g. Node.js,
491
+ browsers) require a file extension for import specifiers.
435
492
 
436
493
  ### Unrecognized path aliases
437
494
 
438
- Knip considers TS config path aliases and [paths configured in knip.json][36],
495
+ Knip considers TS config path aliases and [paths configured in knip.json][39],
439
496
  but not those in e.g. Webpack or Vite configurations.
440
497
 
441
- **Solution**: configure [paths][36] or try relative imports. Otherwise, use
442
- [`ignoreUnresolved`][37] as a last resort.
498
+ **Solution**: configure [paths][39] or try relative imports. Otherwise, use
499
+ [`ignoreUnresolved`][40] as a last resort.
443
500
 
444
501
  ### External aliased imports
445
502
 
446
503
  External libraries may use aliased imports that aren't resolved by Knip.
447
504
 
448
- For instance, [unplugin-icons][10] does this to import icons from icon sets as
505
+ For instance, [unplugin-icons][41] does this to import icons from icon sets as
449
506
  components. Such imports are reported as unused. Use the [`paths` configuration
450
- option][13] to tell Knip where to find the icon types:
507
+ option][39] to tell Knip where to find the icon types:
451
508
 
452
509
  ```json title="knip.json"
453
510
  {
@@ -458,9 +515,9 @@ option][13] to tell Knip where to find the icon types:
458
515
  ```
459
516
 
460
517
  Where `[framework]` is the name of the framework you're using (see [available
461
- types][38]).
518
+ types][42]).
462
519
 
463
- **Solution**: try [--include-libs][39] or configure [paths][36].
520
+ **Solution**: try [--include-libs][43] or configure [paths][39].
464
521
 
465
522
  ## Unused exports
466
523
 
@@ -468,17 +525,17 @@ By default, Knip does not report unused exports of `entry` files.
468
525
 
469
526
  The most common causes for unused exports include:
470
527
 
471
- - [Namespace enumerations][40]
472
- - [External libraries][39]
528
+ - [Namespace enumerations][44]
529
+ - [External libraries][45]
473
530
 
474
- Use the `--exports` flag to [filter][15] and focus only on issues related to
531
+ Use the `--exports` flag to [filter][17] and focus only on issues related to
475
532
  exports:
476
533
 
477
534
  ```sh
478
535
  knip --exports
479
536
  ```
480
537
 
481
- Use [includeEntryExports][41] to report unused exports of entry files as well.
538
+ Use [includeEntryExports][46] to report unused exports of entry files as well.
482
539
  This can be set per workspace.
483
540
 
484
541
  ### Namespace enumerations
@@ -490,7 +547,7 @@ are then **not** reported.
490
547
  **Solution**: if all exports on imported namespaces should be considered
491
548
  individually, include the `nsExports` issue type to disable the heuristic.
492
549
 
493
- See [namespace imports][42] to see all related patterns.
550
+ See [namespace imports][47] to see all related patterns.
494
551
 
495
552
  ### External libraries
496
553
 
@@ -533,16 +590,17 @@ knip --include-libs
533
590
  ```
534
591
 
535
592
  This comes at a performance and memory penalty, but should give better results
536
- if you need it. This flag is implied when [classMembers][44] are included (that
593
+ if you need it. This flag is implied when [classMembers][48] are included (that
537
594
  feature comes with roughly the same performance penalty).
538
595
 
539
596
  ### Exclude exports from the report
540
597
 
541
598
  To exclude false positives from the report, there are a few options:
542
599
 
543
- - [Ignore exports used in file][45] for exports used internally.
544
- - Individual exports can be [tagged using JSDoc syntax][46].
600
+ - [Ignore exports used in file][49] for exports used internally.
601
+ - Individual exports can be [tagged using JSDoc syntax][50].
545
602
  - Have the export in an entry file:
603
+
546
604
  - Add the file to the `entry` file patterns array in the configuration.
547
605
  - Move the export(s) to an entry file.
548
606
  - Add the file to the `exports` field of `package.json`
@@ -551,11 +609,11 @@ To exclude false positives from the report, there are a few options:
551
609
  ### Missing unused exports?
552
610
 
553
611
  Did you expect certain exports in the report, but are they missing? They might
554
- be exported from an entry file. In that case, use [--include-entry-exports][41]
612
+ be exported from an entry file. In that case, use [--include-entry-exports][46]
555
613
  to make Knip also report unused exports in entry files.
556
614
 
557
615
  The exports of non-standard extensions like `.astro`, `.mdx`, `.vue` or
558
- `.svelte` are not available by default. See [compilers][19] for more details on
616
+ `.svelte` are not available by default. See [compilers][21] for more details on
559
617
  how to include them.
560
618
 
561
619
  ### Class members
@@ -570,10 +628,10 @@ knip --include classMembers
570
628
  This option is also available in the Knip configuration file. Note that this
571
629
  feature comes at a cost: linting will take more time and more memory.
572
630
 
573
- Individual class members can be [tagged using JSDoc syntax][46].
631
+ Individual class members can be [tagged using JSDoc syntax][50].
574
632
 
575
633
  Classes exported from entry files are ignored, and so are their members. Use
576
- [--include-entry-exports][41] to make Knip also report members of unused exports
634
+ [--include-entry-exports][46] to make Knip also report members of unused exports
577
635
  in entry files.
578
636
 
579
637
  ### Enum members
@@ -585,62 +643,66 @@ Reporting such members can be disabled:
585
643
  knip --exclude enumMembers
586
644
  ```
587
645
 
588
- Individual enum members can be [tagged using JSDoc syntax][46].
646
+ Individual enum members can be [tagged using JSDoc syntax][50].
589
647
 
590
648
  Enums exported from entry files are ignored, and so are their members. Use
591
- [--include-entry-exports][41] to make Knip also report members of unused exports
649
+ [--include-entry-exports][46] to make Knip also report members of unused exports
592
650
  in entry files.
593
651
 
594
652
  ## Feedback or false positives?
595
653
 
596
654
  If you believe Knip incorrectly reports something as unused (i.e. there's a
597
- false positive), feel free to create a [minimal reproduction][47] and open an
655
+ false positive), feel free to create a [minimal reproduction][51] and open an
598
656
  issue on GitHub. It'll make Knip better for everyone!
599
657
 
600
658
  [1]: #unused-files
601
659
  [2]: #unused-dependencies
602
660
  [3]: #unresolved-imports
603
661
  [4]: #unused-exports
604
- [5]: #missing-generated-files
605
- [6]: #dynamic-import-specifiers
606
- [7]: #unsupported-arguments-in-scripts
607
- [8]: #unsupported-file-formats
608
- [9]: #missing-plugin
609
- [10]: #incomplete-plugin
610
- [11]: #typescript-path-aliases-in-monorepos
611
- [12]: #relative-paths-across-workspaces
612
- [13]: #integrated-monorepos
613
- [14]: #auto-mocking-or-auto-imports
614
- [15]: ../features/rules-and-filters.md#filters
615
- [16]: ./configuring-project-files.md
616
- [17]: ../features/source-mapping.md
617
- [18]: ../features/script-parser.md
618
- [19]: ../features/compilers.md
619
- [20]: ./writing-a-plugin.md
620
- [21]: ../reference/plugins.md
621
- [22]: ../reference/configuration.md#ignoredependencies
622
- [23]: ../explanations/plugins.md#entry-files
623
- [24]: ../explanations/entry-files.md#plugins
624
- [25]: ../reference/faq.md#why-cant-i-use-path-aliases-to-reference-other-workspaces
625
- [26]: ../features/integrated-monorepos.md
626
- [27]: #missing-or-incomplete-plugin
627
- [28]: #unrecognized-reference
628
- [29]: #type-definition-packages
629
- [30]: #unlisted-binaries
630
- [31]: https://github.com/webpro-nl/knip/blob/b70958a58ea255ee7a7831e404786da807ca93d7/packages/knip/src/constants.ts#L37-L139
631
- [32]: ../features/monorepos-and-workspaces.md#lint-a-single-workspace
632
- [33]: #template-strings
633
- [34]: #unrecognized-path-aliases
634
- [35]: #external-aliased-imports
635
- [36]: ../reference/configuration.md#paths
636
- [37]: ../reference/configuration.md#ignoreunresolved
637
- [38]: #build-artifacts-and-ignored-files
638
- [39]: #external-libraries
639
- [40]: #namespace-enumerations
640
- [41]: ../reference/configuration.md#includeentryexports
641
- [42]: ../guides/namespace-imports.md
642
- [43]: ../reference/cli#--include-libs
643
- [44]: #class-members
644
- [45]: ../reference/configuration.md#ignoreexportsusedinfile
645
- [46]: ../reference/jsdoc-tsdoc-tags.md
646
- [47]: ../guides/issue-reproduction
662
+ [5]: ../reference/integrations.md
663
+ [6]: ../reference/configuration-hints.md
664
+ [7]: #missing-generated-files
665
+ [8]: #dynamic-import-specifiers
666
+ [9]: #unsupported-arguments-in-scripts
667
+ [10]: #unsupported-file-formats
668
+ [11]: #missing-plugin
669
+ [12]: #incomplete-plugin
670
+ [13]: #typescript-path-aliases-in-monorepos
671
+ [14]: #relative-paths-across-workspaces
672
+ [15]: #integrated-monorepos
673
+ [16]: #auto-mocking-or-auto-imports
674
+ [17]: ../features/rules-and-filters.md#filters
675
+ [18]: ./configuring-project-files.md
676
+ [19]: ../features/source-mapping.md
677
+ [20]: ../features/script-parser.md
678
+ [21]: ../features/compilers.md
679
+ [22]: ../writing-a-plugin/index.md
680
+ [23]: ../reference/plugins.md
681
+ [24]: ../reference/configuration.md#ignoredependencies
682
+ [25]: ../explanations/plugins.md#entry-files
683
+ [26]: ../explanations/entry-files.md#plugins
684
+ [27]: ../reference/faq.md#why-cant-i-use-path-aliases-to-reference-other-workspaces
685
+ [28]: ../features/integrated-monorepos.md
686
+ [29]: #missing-or-incomplete-plugin
687
+ [30]: #unrecognized-reference
688
+ [31]: #type-definition-packages
689
+ [32]: #dependencies-named-after-nodejs-builtins
690
+ [33]: #unlisted-binaries
691
+ [34]: https://github.com/webpro-nl/knip/blob/e031018e676c47d84873cc2403251c0111ef318d/packages/knip/src/constants.ts#L39-L148
692
+ [35]: ../features/monorepos-and-workspaces.md#filter-workspaces
693
+ [36]: #template-strings
694
+ [37]: #unrecognized-path-aliases
695
+ [38]: #external-aliased-imports
696
+ [39]: ../reference/configuration.md#paths
697
+ [40]: ../reference/configuration.md#ignoreunresolved
698
+ [41]: https://www.npmjs.com/package/unplugin-icons
699
+ [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
@@ -19,6 +19,8 @@ influence the issue at hand, such as:
19
19
  - Dependent or depending workspaces in a monorepo
20
20
  - Knip configuration in `knip.json`
21
21
 
22
+ ## Keep it minimal
23
+
22
24
  Create the minimum of source code and configuration with a few files to
23
25
  reproduce and demonstrate the issue. Having this as a basis has many benefits:
24
26
 
@@ -30,6 +32,12 @@ reproduce and demonstrate the issue. Having this as a basis has many benefits:
30
32
  Providing this with an issue description will help us help you and improve the
31
33
  chances the issue can be looked into efficiently and in a timely manner.
32
34
 
35
+ Useful **complements** to a minimal reproduction might include:
36
+
37
+ - Screenshots, videos, code snippets or log output
38
+ - Links to an existing project repository
39
+ - Applications scaffolded by tools like Angular or Svelte CLI
40
+
33
41
  ## Before opening an issue
34
42
 
35
43
  Before opening an issue, please make sure you:
@@ -42,6 +50,10 @@ Before opening an issue, please make sure you:
42
50
  Please file only a single issue at a time, so each of them can be labeled and
43
51
  tracked separately.
44
52
 
53
+ There is no need to open an issue if you're going to submit a pull request to
54
+ close it right away anyway. In that case it's preferred to keep things central
55
+ in either an issue or pull request.
56
+
45
57
  ## Templates
46
58
 
47
59
  A convenient way to create a minimal reproduction is by starting with one of
@@ -61,21 +73,17 @@ Other solutions to share a minimal and reproducible case may work well too,
61
73
  including:
62
74
 
63
75
  - A public repository on e.g. GitHub or GitLab.
64
- - A new [fixtures folder in the Knip repository][9].
65
-
66
- The goal is to have an easy and common understanding and reproduction. A link to
67
- your existing project repository will likely not be considered "minimal". Issues
68
- containing just a screenshot, or snippets of output or source code don't provide
69
- the full picture and aren't complete nor actionable.
76
+ - A pull request with a new [test][9] and/or [fixture folder][10].
70
77
 
71
- If you're unable to create a reproduction using one of the methods described
72
- then please clearly explain this in the issue or [contact me][10].
78
+ The goal is to have an easy and common understanding and reproduction. If you're
79
+ unable to create a reproduction using one of the methods described then please
80
+ clearly explain this in the issue or [contact me][11].
73
81
 
74
82
  ## Pull Request
75
83
 
76
84
  The optimal way is to add fixtures and failing tests to the Knip repository, and
77
85
  open a pull request to discuss the issue! Also see [instructions for
78
- development][11].
86
+ development][12].
79
87
 
80
88
  [1]: https://github.com/webpro-nl/knip/issues?q=is%3Aissue
81
89
  [2]: https://knip.dev/reference/known-issues
@@ -89,6 +97,7 @@ development][11].
89
97
  https://stackblitz.com/github/webpro-nl/knip/tree/main/templates/issue-reproduction/monorepo
90
98
  [7]: https://codesandbox.io
91
99
  [8]: https://stackblitz.com
92
- [9]: https://github.com/webpro-nl/knip/tree/main/packages/knip/fixtures
93
- [10]: https://github.com/webpro
94
- [11]: https://github.com/webpro-nl/knip/blob/main/.github/DEVELOPMENT.md
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
@@ -59,9 +59,9 @@ on large monorepos.
59
59
 
60
60
  Knip does not install the TypeScript Language Service (LS) by default. This is
61
61
  expensive, as TypeScript needs to set up symbols and caching for the rather slow
62
- `findReferences` function.
62
+ `findReferences` function. Even more so for multiple projects/workspaces.
63
63
 
64
- There are two cases that enforce Knip to install the LS.
64
+ There are two cases that enforce Knip to install the LS:
65
65
 
66
66
  ### 1. Class members
67
67
 
@@ -70,10 +70,11 @@ The `findReferences` function is used to find unused members of imported classes
70
70
 
71
71
  ### 2. Include external type definitions
72
72
 
73
- When [`--include-libs`][3] is enabled, Knip enables loading type definitions of
74
- external dependencies. This will also install the LS to access its
75
- `findReferences` function. It acts as an extra line of defense: only exports
76
- that weren't referenced to during default procedure go through this.
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`.
77
78
 
78
79
  ## Metrics
79
80
 
@@ -85,13 +86,23 @@ those functions. Example usage:
85
86
  knip --include classMembers --performance
86
87
  ```
87
88
 
89
+ ## ignoreExportsUsedInFile
90
+
91
+ The [ignoreExportsUsedInFile][5] option slows down the process slightly.
92
+ Typically, anywhere between 0.25% and 10% of total running time. To find out:
93
+
94
+ ```sh
95
+ knip --performance-fn hasRefsInFile
96
+ ```
97
+
88
98
  ## A last resort
89
99
 
90
100
  In case Knip is unbearably slow (or even crashes), you could resort to [lint
91
- individual workspaces][5].
101
+ individual workspaces][6].
92
102
 
93
103
  [1]: ./configuring-project-files.md
94
104
  [2]: ../reference/cli.md#--isolate-workspaces
95
105
  [3]: ../guides/handling-issues.mdx#external-libraries
96
106
  [4]: ../reference/cli.md#--performance
97
- [5]: ../features/monorepos-and-workspaces.md#lint-a-single-workspace
107
+ [5]: ../reference/configuration.md#ignoreexportsusedinfile
108
+ [6]: ../features/monorepos-and-workspaces.md#filter-workspaces