Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Aug 31, 2024
1 parent f730637 commit 70bf705
Show file tree
Hide file tree
Showing 2 changed files with 138 additions and 131 deletions.
87 changes: 43 additions & 44 deletions packages/docs/src/content/docs/guides/handling-issues.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ On the other hand, to exclude them from the `project` files using negated
}
```

Also see [configuring project files][7] to learn more about `entry` and
Also see [configuring project files][6] to learn more about `entry` and
`project` files, and when to use `ignore` patterns.

### Plugins
Expand All @@ -87,22 +87,22 @@ reported as unused because there is no plugin yet that includes those files. For
example, if `tool.config.js` contains a reference to `@tool/package` then both
the file and the dependency may be reported as an unused.

[Create a new plugin][8] for tools or frameworks that are not [in the list][9]
yet, or [request it][10].
[Create a new plugin][7] for tools or frameworks that are not [in the list][8]
yet, or [request it][9].

#### Existing plugins

Files may be reported as unused if existing plugins do not include that entry
file pattern yet.

See the [plugins section of entry files][11] for more details. [Override plugin
configuration][12] to customize default patterns for existing plugins.
See the [plugins section of entry files][10] for more details. [Override plugin
configuration][11] to customize default patterns for existing plugins.

### Integrated monorepos

Multiple instances of configuration files like `.eslintrc` and
`jest.config.json` across the repository may be reported as unused when working
in a (mono)repo with a single `package.json`. See [integrated monorepos][13] for
in a (mono)repo with a single `package.json`. See [integrated monorepos][12] for
more details and how to configure plugins to target those configuration files.

### Build artifacts and ignored files
Expand All @@ -116,7 +116,7 @@ manually for better or more consistent results.
## Unused dependencies

Dependencies imported in unused files are reported as unused dependencies.
That's why it's strongly recommended to try and remedy [unused files][14] first.
That's why it's strongly recommended to try and remedy [unused files][13] first.
This solves many cases of reported unused dependencies.

:::tip
Expand Down Expand Up @@ -151,7 +151,7 @@ you don't feel like a plugin could solve it, a last resort is to ignore it:
```

Depending on the situation, you may want to use `ignoreBinaries` instead. See
[unlisted binaries][15].
[unlisted binaries][14].

### TypeScript, Jest & ESLint

Expand All @@ -160,7 +160,7 @@ own. Sharing and extending configurations is convenient, but for a project
linter like Knip it can be a challenge to assign dependencies to the right
workspace.

The new [ESLint flat config system][16] does not have this issue, so it's
The new [ESLint flat config system][15] does not have this issue, so it's
recommended to migrate if you haven't already.

We can't "assign" dependencies to other workspaces. But workspaces that use the
Expand Down Expand Up @@ -211,7 +211,7 @@ then this might be caused by `node_modules` not containing the packages. And
this might have been caused by either the way your package manager installs
dependencies, or by not running Knip from the root of the repository.

Knip should run from the root. But you can [lint individual workspaces][17].
Knip should run from the root. But you can [lint individual workspaces][16].

### Example

Expand Down Expand Up @@ -254,8 +254,8 @@ By default, Knip does not report unused exports of `entry` files.
When unused exports are reported, and you want to keep exporting those, there
are a few options:

- [Ignore exports used in file][18] for exports used internally.
- Individual exports can be [tagged using JSDoc syntax][19].
- [Ignore exports used in file][17] for exports used internally.
- Individual exports can be [tagged using JSDoc syntax][18].
- Have the export in or re-exported by an [entry file][2]:
- Add the file to the `entry` file patterns array in the configuration
- Move the export(s) to an entry file
Expand Down Expand Up @@ -313,26 +313,26 @@ Knip does not include external type definitions by default so it won't see the
export being referenced.

To include the type definitions of external libraries, use the
[--include-libs][20] flag:
[--include-libs][19] flag:

```shell
knip --include-libs
```

This comes at a performance and memory penalty, but should give better results
if you need it. This flag is implied when [classMembers][21] are included (that
if you need it. This flag is implied when [classMembers][20] are included (that
feature comes with roughly the same performance penalty).

### Non-standard files

The exports of non-standard extensions like `.astro`, `.mdx`, `.vue` or
`.svelte` are not available by default. See [compilers][22] for more details on
`.svelte` are not available by default. See [compilers][21] for more details on
how to include them.

### Missing exports?

Do you expect certain exports in the report, but are they missing? They might be
exported from an entry file. Use [--include-entry-exports][23] to make Knip also
exported from an entry file. Use [--include-entry-exports][22] to make Knip also
report unused exports in entry files.

## Class members
Expand All @@ -347,10 +347,10 @@ This option is also available in the Knip configuration file. Note that this
feature comes at a cost: linting will take more time and more memory (in rare
cases it may even run out of memory in large repositories).

Individual class members can be [tagged using JSDoc syntax][19].
Individual class members can be [tagged using JSDoc syntax][18].

Classes exported from entry files are ignored, and so are their members. Use
[--include-entry-exports][23] to make Knip also report members of unused exports
[--include-entry-exports][22] to make Knip also report members of unused exports
in entry files.

## Enum members
Expand All @@ -362,10 +362,10 @@ members can also be disabled altogether, for example:
knip --exclude enumMembers
```

Individual enum members can be [tagged using JSDoc syntax][19].
Individual enum members can be [tagged using JSDoc syntax][18].

Enums exported from entry files are ignored, and so are their members. Use
[--include-entry-exports][23] to make Knip also report members of unused exports
[--include-entry-exports][22] to make Knip also report members of unused exports
in entry files.

## False positives
Expand All @@ -374,35 +374,34 @@ If you believe Knip incorrectly reports something as unused (i.e. a false
positive), this could be caused by one of multiple reasons:

- Knip requires additional configuration, for instance additional [entry
files][2] or [paths][24] should be added.
files][2] or [paths][23] should be added.
- Knip has a bug. You can help your own project and Knip by creating a [minimal
reproduction][25] and open an issue on GitHub.
reproduction][24] and open an issue on GitHub.

Also see [troubleshooting][26] if you haven't already.
Also see [troubleshooting][25] if you haven't already.

[1]: ../overview/configuration.md
[2]: ../explanations/entry-files.md
[3]: ../guides/configuring-project-files.md
[4]: ../features/monorepos-and-workspaces.md
[5]: ../features/rules-and-filters.md#filters
[6]: #missing-plugins
[7]: ./configuring-project-files.md
[8]: ./writing-a-plugin.md
[9]: ../reference/plugins.md
[10]: https://github.com/webpro-nl/knip/issues/483
[11]: ../explanations/plugins.md#entry-files
[12]: ../explanations/entry-files.md#plugins
[13]: ../features/integrated-monorepos.md
[14]: #unused-files
[15]: #unlisted-binaries
[16]: https://eslint.org/docs/latest/use/configure/configuration
[17]: ../features/monorepos-and-workspaces.md#lint-a-single-workspace
[18]: ../reference/configuration.md#ignoreexportsusedinfile
[19]: ../reference/jsdoc-tsdoc-tags.md
[20]: ../reference/cli#--include-libs
[21]: #class-members
[22]: ../features/compilers.md
[23]: ../reference/configuration.md#includeentryexports
[24]: ../reference/configuration.md#paths
[25]: ../guides/troubleshooting.md#minimal-reproduction
[26]: ./troubleshooting.md
[6]: ./configuring-project-files.md
[7]: ./writing-a-plugin.md
[8]: ../reference/plugins.md
[9]: https://github.com/webpro-nl/knip/issues/483
[10]: ../explanations/plugins.md#entry-files
[11]: ../explanations/entry-files.md#plugins
[12]: ../features/integrated-monorepos.md
[13]: #unused-files
[14]: #unlisted-binaries
[15]: https://eslint.org/docs/latest/use/configure/configuration
[16]: ../features/monorepos-and-workspaces.md#lint-a-single-workspace
[17]: ../reference/configuration.md#ignoreexportsusedinfile
[18]: ../reference/jsdoc-tsdoc-tags.md
[19]: ../reference/cli#--include-libs
[20]: #class-members
[21]: ../features/compilers.md
[22]: ../reference/configuration.md#includeentryexports
[23]: ../reference/configuration.md#paths
[24]: ../guides/troubleshooting.md#minimal-reproduction
[25]: ./troubleshooting.md
182 changes: 95 additions & 87 deletions packages/docs/src/content/docs/reference/plugins.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Plugins (72)
title: Plugins (76)
tableOfContents: false
---

Expand Down Expand Up @@ -34,49 +34,53 @@ tableOfContents: false
- [Mocha][27]
- [moonrepo][28]
- [Mock Service Worker][29]
- [Netlify][30]
- [Next.js][31]
- [Node.js Test Runner][32]
- [npm-package-json-lint][33]
- [Nx][34]
- [nyc][35]
- [oclif][36]
- [Playwright][37]
- [Playwright for components][38]
- [PostCSS][39]
- [Prettier][40]
- [React Cosmos][41]
- [Release It][42]
- [Remark][43]
- [Remix][44]
- [Rollup][45]
- [Rsbuild][46]
- [Rspack][47]
- [Semantic Release][48]
- [Sentry][49]
- [simple-git-hooks][50]
- [size-limit][51]
- [Storybook][52]
- [Stryker][53]
- [Stylelint][54]
- [Svelte][55]
- [Syncpack][56]
- [Tailwind][57]
- [tsup][58]
- [TypeDoc][59]
- [TypeScript][60]
- [unbuild][61]
- [UnoCSS][62]
- [Vercel OG][63]
- [Vite][64]
- [Vitest][65]
- [Vue][66]
- [WebdriverIO][67]
- [Webpack][68]
- [Wireit][69]
- [Wrangler][70]
- [xo][71]
- [yorkie][72]
- [Nest][30]
- [Netlify][31]
- [Next.js][32]
- [Node.js Test Runner][33]
- [npm-package-json-lint][34]
- [Nuxt][35]
- [Nx][36]
- [nyc][37]
- [oclif][38]
- [Playwright][39]
- [Playwright for components][40]
- [PostCSS][41]
- [Preconstruct][42]
- [Prettier][43]
- [React Cosmos][44]
- [Release It][45]
- [Remark][46]
- [Remix][47]
- [Rollup][48]
- [Rsbuild][49]
- [Rspack][50]
- [Semantic Release][51]
- [Sentry][52]
- [simple-git-hooks][53]
- [size-limit][54]
- [Storybook][55]
- [Stryker][56]
- [Stylelint][57]
- [Svelte][58]
- [Syncpack][59]
- [Tailwind][60]
- [tsup][61]
- [TypeDoc][62]
- [TypeScript][63]
- [unbuild][64]
- [UnoCSS][65]
- [Vercel OG][66]
- [Vike][67]
- [Vite][68]
- [Vitest][69]
- [Vue][70]
- [WebdriverIO][71]
- [Webpack][72]
- [Wireit][73]
- [Wrangler][74]
- [xo][75]
- [yorkie][76]

:::

Expand Down Expand Up @@ -109,46 +113,50 @@ tableOfContents: false
[27]: /reference/plugins/mocha 'Mocha'
[28]: /reference/plugins/moonrepo 'moonrepo'
[29]: /reference/plugins/msw 'Mock Service Worker'
[30]: /reference/plugins/netlify 'Netlify'
[31]: /reference/plugins/next 'Next.js'
[32]: /reference/plugins/node-test-runner 'Node.js Test Runner'
[33]: /reference/plugins/npm-package-json-lint 'npm-package-json-lint'
[34]: /reference/plugins/nx 'Nx'
[35]: /reference/plugins/nyc 'nyc'
[36]: /reference/plugins/oclif 'oclif'
[37]: /reference/plugins/playwright 'Playwright'
[38]: /reference/plugins/playwright-ct 'Playwright for components'
[39]: /reference/plugins/postcss 'PostCSS'
[40]: /reference/plugins/prettier 'Prettier'
[41]: /reference/plugins/react-cosmos 'React Cosmos'
[42]: /reference/plugins/release-it 'Release It'
[43]: /reference/plugins/remark 'Remark'
[44]: /reference/plugins/remix 'Remix'
[45]: /reference/plugins/rollup 'Rollup'
[46]: /reference/plugins/rsbuild 'Rsbuild'
[47]: /reference/plugins/rspack 'Rspack'
[48]: /reference/plugins/semantic-release 'Semantic Release'
[49]: /reference/plugins/sentry 'Sentry'
[50]: /reference/plugins/simple-git-hooks 'simple-git-hooks'
[51]: /reference/plugins/size-limit 'size-limit'
[52]: /reference/plugins/storybook 'Storybook'
[53]: /reference/plugins/stryker 'Stryker'
[54]: /reference/plugins/stylelint 'Stylelint'
[55]: /reference/plugins/svelte 'Svelte'
[56]: /reference/plugins/syncpack 'Syncpack'
[57]: /reference/plugins/tailwind 'Tailwind'
[58]: /reference/plugins/tsup 'tsup'
[59]: /reference/plugins/typedoc 'TypeDoc'
[60]: /reference/plugins/typescript 'TypeScript'
[61]: /reference/plugins/unbuild 'unbuild'
[62]: /reference/plugins/unocss 'UnoCSS'
[63]: /reference/plugins/vercel-og 'Vercel OG'
[64]: /reference/plugins/vite 'Vite'
[65]: /reference/plugins/vitest 'Vitest'
[66]: /reference/plugins/vue 'Vue'
[67]: /reference/plugins/webdriver-io 'WebdriverIO'
[68]: /reference/plugins/webpack 'Webpack'
[69]: /reference/plugins/wireit 'Wireit'
[70]: /reference/plugins/wrangler 'Wrangler'
[71]: /reference/plugins/xo 'xo'
[72]: /reference/plugins/yorkie 'yorkie'
[30]: /reference/plugins/nest 'Nest'
[31]: /reference/plugins/netlify 'Netlify'
[32]: /reference/plugins/next 'Next.js'
[33]: /reference/plugins/node-test-runner 'Node.js Test Runner'
[34]: /reference/plugins/npm-package-json-lint 'npm-package-json-lint'
[35]: /reference/plugins/nuxt 'Nuxt'
[36]: /reference/plugins/nx 'Nx'
[37]: /reference/plugins/nyc 'nyc'
[38]: /reference/plugins/oclif 'oclif'
[39]: /reference/plugins/playwright 'Playwright'
[40]: /reference/plugins/playwright-ct 'Playwright for components'
[41]: /reference/plugins/postcss 'PostCSS'
[42]: /reference/plugins/preconstruct 'Preconstruct'
[43]: /reference/plugins/prettier 'Prettier'
[44]: /reference/plugins/react-cosmos 'React Cosmos'
[45]: /reference/plugins/release-it 'Release It'
[46]: /reference/plugins/remark 'Remark'
[47]: /reference/plugins/remix 'Remix'
[48]: /reference/plugins/rollup 'Rollup'
[49]: /reference/plugins/rsbuild 'Rsbuild'
[50]: /reference/plugins/rspack 'Rspack'
[51]: /reference/plugins/semantic-release 'Semantic Release'
[52]: /reference/plugins/sentry 'Sentry'
[53]: /reference/plugins/simple-git-hooks 'simple-git-hooks'
[54]: /reference/plugins/size-limit 'size-limit'
[55]: /reference/plugins/storybook 'Storybook'
[56]: /reference/plugins/stryker 'Stryker'
[57]: /reference/plugins/stylelint 'Stylelint'
[58]: /reference/plugins/svelte 'Svelte'
[59]: /reference/plugins/syncpack 'Syncpack'
[60]: /reference/plugins/tailwind 'Tailwind'
[61]: /reference/plugins/tsup 'tsup'
[62]: /reference/plugins/typedoc 'TypeDoc'
[63]: /reference/plugins/typescript 'TypeScript'
[64]: /reference/plugins/unbuild 'unbuild'
[65]: /reference/plugins/unocss 'UnoCSS'
[66]: /reference/plugins/vercel-og 'Vercel OG'
[67]: /reference/plugins/vike 'Vike'
[68]: /reference/plugins/vite 'Vite'
[69]: /reference/plugins/vitest 'Vitest'
[70]: /reference/plugins/vue 'Vue'
[71]: /reference/plugins/webdriver-io 'WebdriverIO'
[72]: /reference/plugins/webpack 'Webpack'
[73]: /reference/plugins/wireit 'Wireit'
[74]: /reference/plugins/wrangler 'Wrangler'
[75]: /reference/plugins/xo 'xo'
[76]: /reference/plugins/yorkie 'yorkie'

0 comments on commit 70bf705

Please sign in to comment.