Skip to content

Commit

Permalink
Edit docs
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Sep 3, 2024
1 parent d8df5e1 commit 5ca20de
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The following commands are similar:

```sh
unimported
knip --production --dependencies --include files
knip --production --dependencies --files
```

**Project status**: The project is archived and recommends Knip.
Expand Down
28 changes: 12 additions & 16 deletions packages/docs/src/content/docs/guides/handling-issues.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,15 @@ unused files = project files - (entry files + resolved files)
In this section we'll look into common patterns that cause unused files and how
to handle them.

:::tip

Use `--include files` to [filter the report][5] by unused files:
Use `--files` to [filter the report][5] and focus on unused files:

```sh
knip --include files
knip --files
```

:::

This might help with other issue types as well. For instance, use
`--dependencies` to focus only on dependencies and exclude issues related to
unused files and exports.
This works with other issue types as well. For instance, use `--dependencies` to
focus only on dependencies and exclude issues related to unused files and
exports.

### Implicit imports

Expand Down Expand Up @@ -119,16 +115,20 @@ Dependencies imported in unused files are reported as unused dependencies.
That's why it's strongly recommended to try and remedy [unused files][13] first.
This solves many cases of reported unused dependencies.

:::tip
:::caution[Monorepo]

In a monorepo, a dependency is unused in the root workspace's `package.json` if
it's also listed in an descendent workspace, and referenced only in the
descendent workspace.

:::

Use the `--dependencies` flag to [filter][5] dependency related issues:

```sh
knip --dependencies
```

:::

### Plugins

If a plugin exists and the dependency is referenced in the configuration file,
Expand Down Expand Up @@ -262,17 +262,13 @@ are a few options:
- Re-export the unused export(s) from an entry file
- Add the file to the `exports` field of `package.json`

:::tip

Use the `--exports` flag to [filter][5] and focus only on issues related to
exports:

```sh
knip --exports
```

:::

### External libraries

Are the exports consumed or imported by an external library, resulting in a
Expand Down

0 comments on commit 5ca20de

Please sign in to comment.