diff --git a/packages/docs/src/components/Projects.astro b/packages/docs/src/components/Projects.astro index 4385f5c70..061d2561f 100644 --- a/packages/docs/src/components/Projects.astro +++ b/packages/docs/src/components/Projects.astro @@ -10,6 +10,7 @@
  • Nuxt
  • Prettier
  • Release It! +
  • Storybook
  • Svelte
  • Query, Table (TanStack)
  • TypeScript (Microsoft)
  • diff --git a/packages/docs/src/content/docs/explanations/why-use-knip.md b/packages/docs/src/content/docs/explanations/why-use-knip.md index 3a0df678e..ccae58ac8 100644 --- a/packages/docs/src/content/docs/explanations/why-use-knip.md +++ b/packages/docs/src/content/docs/explanations/why-use-knip.md @@ -103,9 +103,9 @@ consider comments like the following: ``` Maybe you wonder why Knip does not have similar comments like `// knip-ignore` -so you can easily get rid of false positives? A variety of reasons: +so you can get rid of false positives? A variety of reasons: -1. A false positive may be a bug in Knip, and should be reported (not easily +1. A false positive may be a bug in Knip, and should be reported (not dismissed). 2. Instead of proprietary comments, use [standardized annotations][11] serving as documentation as well. diff --git a/packages/docs/src/content/docs/features/reporters.md b/packages/docs/src/content/docs/features/reporters.md index f62d3d406..55d76128f 100644 --- a/packages/docs/src/content/docs/features/reporters.md +++ b/packages/docs/src/content/docs/features/reporters.md @@ -105,9 +105,9 @@ Markdown tables separated by issue types as headings, for example: ## Custom Reporters -When the provided built-in reporters are not quite sufficient, a custom local -reporter can be implemented or an external reporter can be used. Multiple -reporters can be used at once by repeating the `--reporter` argument. +When the provided built-in reporters are not sufficient, a custom local reporter +can be implemented or an external reporter can be used. Multiple reporters can +be used at once by repeating the `--reporter` argument. The results are passed to the function from its default export and can be used to write issues to `stdout`, a JSON or CSV file, or sent to a service. It @@ -166,8 +166,8 @@ A preprocessor is a function that runs after the analysis is finished. It receives the results from the analysis and should return data in the same shape/structure (unless you pass it to only your own reporter). -The data goes through the preprocessor(s) before the final data is passed to the -reporter(s). There are no built-in preprocessors. Just like reporters, use e.g. +The data goes through the preprocessors before the final data is passed to the +reporters. There are no built-in preprocessors. Just like reporters, use e.g. `--preprocessor ./my-preprocessor` from the command line (can be repeated). The default export of the preprocessor should be a function with this interface: diff --git a/packages/docs/src/content/docs/guides/issue-reproduction.md b/packages/docs/src/content/docs/guides/issue-reproduction.md index d7b9d669a..f8662b2f4 100644 --- a/packages/docs/src/content/docs/guides/issue-reproduction.md +++ b/packages/docs/src/content/docs/guides/issue-reproduction.md @@ -6,7 +6,9 @@ If you encounter an issue or false positives when using Knip, you can [open an issue on GitHub][1]. This will help you in your project, and will also improve Knip for everyone else! -There are many factors that may influence the issue at hand, such as: +Think of Knip like a kitchen sink, it handles a large amount of projects and +configurations, and your project is different from all others. Many factors may +influence the issue at hand, such as: - Code syntax, import and export structure in source files - Dependencies, scripts and entry files in `package.json` @@ -15,16 +17,11 @@ There are many factors that may influence the issue at hand, such as: - Dependent or depending workspaces in a monorepo - Knip configuration in `knip.json` -Think of Knip like a kitchen sink, it handles a large amount of projects and -configurations, and your project is different from all others. That's why it's -required to provide a minimal reproduction. This contains only the source code -and configuration required to demonstrate the issue. Providing this with a clear -issue description will help us help you, and greatly improves the chances your -issue will be looked into efficiently and in a timely manner. - -Issues containing just a screenshot, a snippet of output, or a snippet of source -code don't tell the full picture. Only an actual reproduction of the issue with -source code and configuration is complete and actionable. +That's why it's required to provide a minimal reproduction: only the source code +and configuration required to reproduce and demonstrate the issue. This makes it +easier to reason about, discuss further and work with. Providing this with an +issue description will help us help you and improve the chances the issue can be +looked into efficiently and in a timely manner. ## Before opening an issue @@ -40,7 +37,7 @@ tracked separately. ## Templates -A convenient way to create a minimal reproduction so is by starting with one of +A convenient way to create a minimal reproduction is by starting with one of these templates in CodeSandbox or StackBlitz: | Template | | | @@ -51,18 +48,21 @@ these templates in CodeSandbox or StackBlitz: Shoutout to [CodeSandbox][7] and [StackBlitz][8] for generously providing these free dev containers! +## Alternatives + Other solutions may work well too. For instance, many people choose to create a small repository on GitHub. The goal is to have an easy and common understanding -and reproduction. - -Providing a link to your existing project repository will likely not be -considered "minimal". +and reproduction. A link to your existing project repository will likely not be +considered "minimal". Issues containing just a screenshot, or snippets of output +or source code don't provide the full picture and aren't complete nor +actionable. If you're unable to create a reproduction using one of the methods +described then please clearly explain this in the issue or [contact me][9]. ## Pull Request -The optimal way is to add fixtures and/or failing tests to the Knip repository, -and open a pull request to discuss the issue! Also see [instructions for -development][9]. +The optimal way is to add fixtures and failing tests to the Knip repository, and +open a pull request to discuss the issue! Also see [instructions for +development][10]. [1]: https://github.com/webpro-nl/knip/issues?q=is%3Aissue [2]: https://knip.dev/reference/known-issues @@ -76,4 +76,5 @@ development][9]. https://stackblitz.com/github/webpro-nl/knip/tree/main/templates/issue-reproduction/monorepo [7]: https://codesandbox.io [8]: https://stackblitz.com -[9]: https://github.com/webpro-nl/knip/blob/main/.github/DEVELOPMENT.md +[9]: https://github.com/webpro +[10]: https://github.com/webpro-nl/knip/blob/main/.github/DEVELOPMENT.md diff --git a/packages/docs/src/content/docs/reference/cli.md b/packages/docs/src/content/docs/reference/cli.md index 0aa738b70..754c988d9 100644 --- a/packages/docs/src/content/docs/reference/cli.md +++ b/packages/docs/src/content/docs/reference/cli.md @@ -226,7 +226,7 @@ Available [issue types][13] when filtering output using `--include` or ### `--exclude` -Exclude provided issue type(s) from report. Can be comma-separated or repeated. +Exclude provided issue types from report. Can be comma-separated or repeated. Example: @@ -237,7 +237,7 @@ knip --exclude classMembers --exclude enumMembers ### `--include` -Report only provided issue type(s). Can be comma-separated or repeated. +Report only provided issue types. Can be comma-separated or repeated. Example: @@ -333,7 +333,7 @@ knip --reporter codeowners --reporter-options '{"path":".github/CODEOWNERS"}' ### `--preprocessor [preprocessor]` -Preprocess the results before providing it to the reporter(s). +Preprocess the results before providing it to the reporters. Can be repeated. Examples: diff --git a/packages/docs/src/content/docs/reference/faq.md b/packages/docs/src/content/docs/reference/faq.md index 29fa6d7ad..0f0aa9808 100644 --- a/packages/docs/src/content/docs/reference/faq.md +++ b/packages/docs/src/content/docs/reference/faq.md @@ -281,7 +281,7 @@ dependencies. Knip includes basic "compilers" for a few common file types (Astro, MDX, Svelte, Vue). Knip does not include actual compilers for reasons of potential incompatibility with the existing compiler, and dependency size. Knip allows to -override them with the compiler(s) in your project, and add additional ones for +override them with the compilers in your project, and add additional ones for other file types. ### Why are the exports of my `.vue` files not used? diff --git a/packages/docs/src/content/docs/reference/unsupported.md b/packages/docs/src/content/docs/reference/unsupported.md index aecc82721..0b9c37805 100644 --- a/packages/docs/src/content/docs/reference/unsupported.md +++ b/packages/docs/src/content/docs/reference/unsupported.md @@ -7,7 +7,7 @@ This page is an overview of related features Knip does not support. ## Unused variables Knip doesn't look for unused variables within a file. It looks for exported and -imported values and types. +imported values and types across files. Use [ESLint][1], [Biome][2] or [oxc][3] to find unused variables within files. @@ -17,7 +17,8 @@ Knip does not yet support finding unused members of types, interfaces and objects. This includes returned objects from exported functions and objects passed as React component props. -Knip does support finding unused members of enums and classes. +Knip does support finding unused members of enums and classes, and exported +values and types on imported namespaces. ## Circular dependencies diff --git a/packages/docs/src/pages/sponsors.astro b/packages/docs/src/pages/sponsors.astro index a73cf116b..af416039d 100644 --- a/packages/docs/src/pages/sponsors.astro +++ b/packages/docs/src/pages/sponsors.astro @@ -9,7 +9,7 @@ import Tweets from '../components/Tweets.astro';

    - Knip is a powerful tool that helps hundreds of developers keep their + Knip is a powerful tool that helps thousands of developers keep their JavaScript and TypeScript projects lean and maintainable. By identifying unused files, dependencies and exports, Knip saves teams valuable time.