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

(feat) support node16/nodenext #1526

Merged
merged 4 commits into from Jun 18, 2022
Merged

Conversation

dummdidumm
Copy link
Member

@dummdidumm dummdidumm commented Jun 16, 2022

#1522

Not sure how to test this, I thought that this would error if I leave out .js in imports but that's not the case, so I'm not sure if this is actually working. @jasonlyu123 @JuanM04 do you know more? Edit: Turns out that was an error on our part, we need to pass a new parameter to resolveModuleNames in the TypeScript plugin.

@JuanM04 would be great if you could test this out:

  1. Check out this branch
  2. Make sure you have yarn 1.x
  3. yarn install
  4. yarn bootstrap
  5. go in language-server and run yarn build
  6. go in svelte-check and run yarn build
  7. copy over dist folder into your project (replace the dist folder of your existing svelte-check in your node_modules)

@JuanM04
Copy link

JuanM04 commented Jun 16, 2022

I tried it in my project where I first saw the bug and it seems to work!

@dummdidumm
Copy link
Member Author

Great to hear that! Was the bug around not respecting the exports map of a package? What I'm still confused about is that I don't seem to get errors from TS about missing file endings (.js) from relative imports

@JuanM04
Copy link

JuanM04 commented Jun 16, 2022

Was the bug around not respecting the exports map of a package?

Yes, that's how I've spotted it. In fact, I have a dependency with broken exports and now svelte-check detects it.

What I'm still confused about is that I don't seem to get errors from TS about missing file endings (.js) from relative imports

Maybe svelte2tsx has something to do with it?

@dummdidumm
Copy link
Member Author

dummdidumm commented Jun 17, 2022

Mhm we might need to also check the resolution mode, as implemented here TypeStrong/ts-node#1778 and exposed since 4.7 (microsoft/TypeScript#49360). Edit: Yep that fixes the "no errors for missing .js extension" problem.

@dummdidumm dummdidumm marked this pull request as ready for review June 18, 2022 09:39
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.

None yet

2 participants