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

Add support for nodenext moduleResolution #149

Merged
merged 5 commits into from
Jun 30, 2022

Conversation

perrin4869
Copy link
Contributor

@perrin4869 perrin4869 commented Jun 13, 2022

Edit: Sorry, failed to leave a description!
This change aims to set the moduleResolution to nodenext or node16 when appropriate.
This allows for using nodenext features inside tsd test files, such as self-module imports, which I have tested here.
This is the feature that I am missing to incorporate tsd in dotcore64/p-from-callback#15
Thanks!

@perrin4869
Copy link
Contributor Author

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.
Copy link
Collaborator

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";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use single-quotes.

@@ -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 => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 => {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants