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(types): ensure compiler directives are at top #7828

Closed
wants to merge 3 commits into from

Conversation

johanbay
Copy link
Collaborator

@johanbay johanbay commented Dec 7, 2021

The workaround to make Puppeteers types work without DOM types
unfortunately breaks tsc's module resolution, since it put a declaration
before a triple-slash compiler directive. This makes the directive
invalid and it is therefore ignored by the typescript compiler when
resolving modules.

This fix instead appends the global.d.ts declarations at the end of
the generated types.d.ts file, ensuring that any directives stays at
the top of the file.

The workaround to make Puppeteers types work without DOM types
unfortunately breaks tsc's module resolution, since it put a declaration
before a tripple slash compiler directive. This makes the directive
invalid and it is therefore ignored by the typescript compiler when
resolving modules.

This fix instead appends the `global.d.ts` declarations at the end of
the generated `types.d.ts` file, ensuring that any directives stays at
the top of the file.
@mathiasbynens
Copy link
Member

FYI @jackfranklin

@jackfranklin
Copy link
Collaborator

LGTM!

@johanbay
Copy link
Collaborator Author

johanbay commented Dec 9, 2021

After thinking a bit more about this, I think we should move forward by reverting instead: #7829

@johanbay johanbay closed this Dec 9, 2021
@jrandolf jrandolf deleted the fix-compiler-directive branch May 3, 2022 13:04
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

4 participants