https://codesandbox.io/p/sandbox/musing-gagarin-d4vvr9
In a Cypress config, setting "reporter": "junit"
causes knip to incorrectly report junit
as an unlisted dependency. Cypress bundles a junit reporter (see https://docs.cypress.io/guides/tooling/reporters) and does not depend on the junit
package (I verified this by installing Cypress and then doing npm ls junit
). The Junit functionality appears to be somewhere inside the Cypress package.
Here is the report knip produces:
Unlisted dependencies (1)
junit cypress.config.ts
Looking at the plugin code for cypress, it appears to assume all listed reporters are package names, even though this isn't correct (not sure I've read this correctly!)
https://github.com/webpro-nl/knip/blob/main/packages/knip/src/plugins/cypress/helpers.ts
I can install the junit
package but that seems wasteful. I could also switch to another Junit reporter (e.g. mocha-junit-reporter
) but that also seems pointless.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too