Skip to content

Fix debug assert for type assertions / JSX #52919

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

Merged
merged 1 commit into from
Feb 22, 2023

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Feb 22, 2023

For vuejs/language-tools#2434

Plugins can have their own script kinds / extensions / variants, which means that LanguageVariant.JSX and ScriptKind.TS are not mutually exclusive.

Just fix the assert to check the language variant, which is what we actually use to determine if a file should contain JSX elements (and therefore cannot contain old style type assertions).

I'd write a test for this, but, there don't appear to be any tests for external script kinds and this is supposed to be best-effort to prevent potential oddities / crashes in the checker anyway.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Feb 22, 2023
@jakebailey jakebailey requested a review from mjbvz February 22, 2023 18:44
@jakebailey jakebailey merged commit 3267c76 into microsoft:main Feb 22, 2023
@jakebailey jakebailey deleted the remove-debug-assert-jsx branch February 22, 2023 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants