Skip to content

[compiler playground] Use TS model for typescript language input#36523

Open
ianduvall wants to merge 1 commit into
facebook:mainfrom
ianduvall:ianduvall/playground-monaco-typescript
Open

[compiler playground] Use TS model for typescript language input#36523
ianduvall wants to merge 1 commit into
facebook:mainfrom
ianduvall:ianduvall/playground-monaco-typescript

Conversation

@ianduvall
Copy link
Copy Markdown
Contributor

@ianduvall ianduvall commented May 21, 2026

The playground forced every source into a file:///index.js Monaco model bound to the JS language service, so TypeScript-only syntax (as, parameter type annotations) rendered with persistent "can only be used in TypeScript files." diagnostics even when the language picker was set to TypeScript.

When the language is typescript, load an index.tsx model with language: 'typescript' so Monaco's TS service parses TS syntax natively without those squiggles. Flow input still uses the JS model with semantic validation suppressed, since Monaco doesn't ship Flow as a built-in language.

Flow support remains unchanged.

@meta-cla meta-cla Bot added the CLA Signed label May 21, 2026
@ianduvall ianduvall force-pushed the ianduvall/playground-monaco-typescript branch from bd600e4 to b360673 Compare May 21, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant