Side-effect imports are checked if file uses JSX: unintentional breaking change? #28538
Labels
Bug
A bug in TypeScript
Domain: Declaration Emit
The issue relates to the emission of d.ts files
Domain: JSX/TSX
Relates to the JSX parser and emitter
High Priority
Milestone
Commit 7a71887 (#27340) appears to have introduced an unintentional breaking change: side-effect module imports are now checked, but only if the file uses JSX. This is currently causing the DefinitelyTyped CI (which uses
typescript@next
) to fail on@types/react-table
.TypeScript Version: 7a71887 (problem does not occur in 12e371b)
Search Terms: side effect module import jsx
Code
Expected behavior: No compile error.
Actual behavior:
error TS2307: Cannot find module 'nope'.
But if the JSX element is removed from the file, the error goes away.Playground Link: N/A, React dependency
Related Issues: #28032, etc. for the previous behavior
The text was updated successfully, but these errors were encountered: