-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
jest-util pollutes types with own version of @types/node #8092
Comments
I was afraid something like this would be an issue. It's really unfortunate that TS allows the global namespace to be polluted by dependencies of dependencies
Then |
How about having the types as a peer or optional dependency |
@SimenB Isn't the |
If Jest's public API (the compiled declaration files) rely on |
I believe that, in the case where EDIT RXJS choice is to put it inside If you use rxjs with TypeScript you need to manually add |
Yeah, I think we'll do that as well. Sindre Sorhus does the same thing when adding typings now. The error TSC throws is pretty clear. Anybody wanna send a PR? We can just add Note that this is just |
Hi @SimenB, out of curiosity, can you clarify which approach you would like to take? dubzzz's proposal? |
|
Do you mean in |
The root package.json is |
Is there a plan to publish a new jest version which includes this change? |
There'll be a release next week |
Hi @SimenB, it looks like #10248 went backward in regard to this issue. Was it intentional? I'm asking because we are thinking of upgrading jest but we get tons of type error when trying to do so. I'm not really sure what we can do, apart from having our front-end tests in their own project and ignore typescript compile errors there. Many thanks, |
See #10937 for latest status |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
As part of the migration to typescript,
jest-util
now has a dependency on @types/node.This creates issues with code that will be written in a consuming TypeScript application, since some function types are modified (e.g.
setTimeout
). You can see more comments on similar issues here: DefinitelyTyped/DefinitelyTyped#21310I propose to remove the @types/node dependency from the jest-util package, in order to not affect any code that is written by the user.
The text was updated successfully, but these errors were encountered: