Skip to content

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