Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To read TypeScript configuration files Jest requires "ts-node" #620

Closed
marco-carvalho opened this issue May 2, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@marco-carvalho
Copy link
Contributor

I have a project with a jest.config.ts, and ts-node and jest both installed. But knip shows me that ts-node is a Unused devDependencies. This is a bug or am I missing something?

https://jestjs.io/docs/configuration

To read TypeScript configuration files Jest requires ts-node. Make sure it is installed in your project.

@marco-carvalho marco-carvalho added the bug Something isn't working label May 2, 2024
@marco-carvalho marco-carvalho changed the title Jest requires "ts-node" to read TypeScript configuration files To read TypeScript configuration files Jest requires "ts-node" May 2, 2024
@webpro
Copy link
Collaborator

webpro commented May 3, 2024

If there's no reference to ts-node then Knip will report it as unused.

Knip can't assume ts-node is required, otherwise it would be incorrectly reported as an unlisted dependency in situations where it's not used.

But if there's a way to figure out this distinction, we can add a condition. For instance, "if the config file ends with .ts then ts-node is required".

@marco-carvalho
Copy link
Contributor Author

marco-carvalho commented May 3, 2024

jestjs/jest#14752 related

Edit: I think this is a Jest problem, so I'm gonna close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants