-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add support for nodenext moduleResolution #149
Add support for nodenext moduleResolution #149
Conversation
closes #144 |
readme.md
Outdated
@@ -153,7 +153,7 @@ These options will be overridden if a `tsconfig.json` file is found in your proj | |||
} | |||
``` | |||
|
|||
*Default options will apply if you don't override them explicitly.* You can't override the `moduleResolution` option. | |||
*Default options will apply if you don't override them explicitly.* You can't override the `moduleResolution` option. `moduleResolution` is set to `nodenext` if `module` is `nodenext`, `node16` if `module` is `node16` or `node` otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to explain this using a code comment on line 139
@@ -0,0 +1 @@ | |||
module.exports.default = "foo"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use single-quotes.
source/test/fixtures/module-resolution/node16-from-package-json/package.json
Show resolved
Hide resolved
source/test/test.ts
Outdated
@@ -138,6 +138,30 @@ test('allow specifying a lib in tsconfig.json', async t => { | |||
verify(t, diagnostics, []); | |||
}); | |||
|
|||
test('use moduleResolution NodeNext when module is nodenext in tsconfig.json', async t => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test('use moduleResolution NodeNext when module is nodenext in tsconfig.json', async t => { | |
test('use moduleResolution `nodenext` when module is `nodenext` in tsconfig.json', async t => { |
Edit: Sorry, failed to leave a description!
This change aims to set the
moduleResolution
tonodenext
ornode16
when appropriate.This allows for using
nodenext
features insidetsd
test files, such asself-module imports
, which I have tested here.This is the feature that I am missing to incorporate
tsd
in dotcore64/p-from-callback#15Thanks!