Closed ElPrudi closed 1 year ago
Yeah, this should be documented better.
The problem here is that Knip does not know what is an npm package and what is an OS binary. While for echo
and exit
this may sound obvious, it's hard to draw a line here. Currently only these binaries are ignored: https://github.com/webpro/knip/blob/main/src/constants.ts#L20
Perhaps I should just add exit
and echo
to the list, since these packages are 9 and 12 years old, respectively.
For now you could add ignoreBinaries: ["echo", "exit"]
to the Knip config.
I think it would be useful to add the most commonly used Linux, CMD and PowerShell commands as I think these are very commonly included in scripts across plattforms. And to point out on the README if they are OS commands. Links: https://kinsta.com/blog/linux-commands/ https://www.digitalcitizen.life/best-cmd-commands/ https://www.educba.com/powershell-commands/
It's not the end of the world, but it's important to have heard of it.
Thanks for your input! I've added a few binaries to the ignore list (1.7.0) and a small section in the readme.
I am going to close this, as it now covers these os commands. Thank you for your blazingly fast response and keep up the good work!
knip version: 1.6.1
A little funny thing about running knip after using
npm init -y
is that it sees the generated scriptas unresolved dependencies:
I have little idea about operating systems, but I think it will react the same way with other OS commands.