From 2e09608df69de3acf1245d6068279127b3d4e816 Mon Sep 17 00:00:00 2001 From: Lars Kappert Date: Tue, 17 Sep 2024 16:25:25 +0200 Subject: [PATCH] Update docs --- .../content/docs/guides/handling-issues.mdx | 69 ++++++++++++------- .../content/docs/guides/troubleshooting.md | 2 +- packages/docs/src/styles/hero.css | 10 +-- packages/knip/README.md | 2 +- 4 files changed, 52 insertions(+), 31 deletions(-) diff --git a/packages/docs/src/content/docs/guides/handling-issues.mdx b/packages/docs/src/content/docs/guides/handling-issues.mdx index a8bde036d..1dbfe5d72 100644 --- a/packages/docs/src/content/docs/guides/handling-issues.mdx +++ b/packages/docs/src/content/docs/guides/handling-issues.mdx @@ -10,10 +10,10 @@ A long report can be frustrating. The list may contain false positives, but also actual clutter. To get the most value out of Knip, it may require some initial configuration. -This page guides you in dealing with false positives. It makes sense to go over -the issue types one by one. For instance, reducing the number of unused files -will also reduce the number of unused dependencies. Therefore it's recommended -to work this page from top to bottom. +This page guides you in dealing with false positives. Especially if you start +out using Knip in a large project and have a long report, it makes sense to go +over the issue types one by one. For instance, reducing the number of unused +files will also reduce the number of unused dependencies. ## Unused files @@ -37,9 +37,6 @@ Let's go over common causes for adding `entry` patterns manually: - [Build artifacts and ignored files][7] - [Auto-mocking or auto-imports][8] -The recommended solution is usually to add the file as shown in each example as -an `entry` file. - :::caution Please don't add unused files to the `ignore` option before reading [configuring @@ -66,6 +63,8 @@ Dynamic import specifiers aren't resolved, such as: const entry = await import(path.join(baseDir, 'entry.ts')); ``` +Solution: add `entry.ts` to `entry` patterns. + ### Unsupported arguments in scripts Some tooling command arguments aren't recognized: @@ -83,6 +82,8 @@ Some tooling command arguments aren't recognized: The same goes for other scripts such as those in GitHub Actions workflows or Git hooks. See [script parser][11] for what Knip does support. +Solution: add `entry.ts` to `entry` patterns. + ### Unsupported file formats Entry files referenced in HTML files (e.g. `