-
-
Notifications
You must be signed in to change notification settings - Fork 943
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
docs: replace deprecated moduleResolution #3018
Conversation
✅ Deploy Preview for fakerjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I personally use "Bundler" today, but this is due to I only use tsup, esbuild or Vite for my projects |
@Shinigami92 I usually use "moduleResolution": "Node16", // "NodeNext" or "Bundler" This way, users will have a range of compatible and non-deprecated options. |
Does not sound wrong to me 👍 @faker-js/maintainers what's your thoughts about that? |
We require at least node 18 so Node16 should be a safe value to use. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #3018 +/- ##
==========================================
- Coverage 99.97% 99.96% -0.01%
==========================================
Files 2747 2747
Lines 226148 226148
Branches 591 591
==========================================
- Hits 226093 226074 -19
- Misses 55 74 +19 |
I think this is exactly the problem and not how that property works. It is totally confusing for persons that are not read into the details and just assume that the number after that means that. Node10, Node16 and NodeNext are telling the TS compiler how imports should work. So e.g. more like CJS or ESM and if |
All values we put there have side effects (maybe except node10 and less so for bundler).
That's why I consider using the more modern suggestion bundler (with the other values as comments).
I couldn't find any limitations regarding that option except for node16 and ts5 (matching our requirements), but I found hints at other incompatibilities such as tooling and backwards compatibility, but I was unable to fully grasp them. EDIT: If we are going for the least likely values to break, then those are only node10 and bundler and not NodeNext. |
I like this:
EDIT: Now about removing esInterop, you're in charge. I can update the pr with this modification too |
353ade7
to
6ff4f07
Compare
You might have to change the code highlighting to jsonc or something. |
adjusted |
Actually, this library won't work with https://nodejs.org/api/esm.html#mandatory-file-extensions So this code in
as it is missing the Specifically when I say it won't work, I mean the TypeScript compiler will not find the type definitions. Essentially this library is completely untyped when using NodeNext. |
Currently, in the recommendation documentation for tsconfig files, when setting
a message appears indicating that this value is deprecated and recommends using
Node10
.This pull request updates the documentation to recommend using the suggested setting.