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

Fix paths in types for nodenext #78

Merged
merged 1 commit into from Jun 9, 2022
Merged

Fix paths in types for nodenext #78

merged 1 commit into from Jun 9, 2022

Conversation

Josh-Cena
Copy link
Contributor

@Josh-Cena Josh-Cena commented Jun 9, 2022

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and couldn’t find anything (or linked relevant results below)
  • If applicable, I’ve added docs and tests

Description of changes

In TS 4.7, the new moduleResolution: NodeNext mode would determine whether declaration files are ESM or CJS as well. If a declaration is thought to be ESM (e.g. because the package.json contains type: module), all imports must have .js extensions.

We are already doing a great job and most import paths have .js extensions. The only offending one is "..". This blocks the build without using skipLibCheck, which causes facebook/docusaurus#7586 to fail. Docusaurus is not adding skipLibCheck for our website because we have some hand-written declaration files, and in order to ensure their correctness we have to check them when compiling. This is the limitation of TS because TS does not allow excluding some declaration files while including others.

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Jun 9, 2022
@wooorm wooorm changed the title fix: always use fully specified paths in type declaration Fix paths in types for nodenext Jun 9, 2022
@wooorm wooorm merged commit 66189a4 into vfile:main Jun 9, 2022
@wooorm wooorm added the 💪 phase/solved Post is done label Jun 9, 2022
@Josh-Cena Josh-Cena deleted the fix-decl branch June 9, 2022 11:05
@github-actions

This comment has been minimized.

@wooorm wooorm added the ☂️ area/types This affects typings label Jun 9, 2022
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Jun 9, 2022
@wooorm
Copy link
Member

wooorm commented Jun 9, 2022

Thanks! I was working on the docs locally, which I’ll bundle with this. So expect a release this evening or tomorrow!

@Josh-Cena
Copy link
Contributor Author

Thanks! I'll hold off facebook/docusaurus#7586 till then.

@wooorm
Copy link
Member

wooorm commented Jun 11, 2022

Thanks, released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☂️ area/types This affects typings 💪 phase/solved Post is done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants