knip icon indicating copy to clipboard operation
knip copied to clipboard

📘 Invalid keys of "Issue Types"

Open evermake opened this issue 2 months ago • 2 comments

Link

https://knip.dev/reference/issue-types

Description of the issue

  • key for "Unused devDependencies" should be devDependencies
  • key for "Referenced optional peerDependencies" should be optionalPeerDependencies

evermake avatar Dec 07 '25 07:12 evermake

Yes and no. You're technically correct, but from a user's perspective usually only dependencies is relevant:

  • https://knip.dev/features/rules-and-filters
  • https://knip.dev/reference/cli#--dependencies

The idea is that --dependencies is a shorthand flag and e.g. devDependencies are handled for you based on running production mode or not.

That said, it is indeed possible to configure e.g. exclude: ['optionalPeerDependencies'] although I think it's not so common.

Does that clear things up? Regardless, there's definitely room to improve the docs.

webpro avatar Dec 08 '25 05:12 webpro

@webpro, oh, I see a point in the "Notes" section. Didn't notice it. Maybe, it'd be more clear, if we add footnotes to related items (e.g. "Unused devDependencies", "Referenced optional peerDependencies", "Unused exported types")?

evermake avatar Dec 09 '25 13:12 evermake