fix: Correct context for declaration files #847
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes "Cannot find module 'styled-jsx' or its corresponding type declarations"
The
scoped-jsx
codemod has a known, bad transform where it adds the import outside of thedeclare module
changing the context of the declaration. This resulted instyled-jsx
having no type declarations.Originally caught in https://github.com/vercel/next.js/actions/runs/9227067088/job/25388269813?pr=66185#step:28:384.
Added a type-checking setup to smoke test types. This would've caught this bug i.e. this PR would fail without the last commit.