-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: should be able to parse decorators in script lang="ts" & jsx (#2088
) * fix: should be able to parse decorators in script lang="ts" * fix: should also support parsing jsx Added to `compileScript` instead of `babelParserDefaultPlugins` because it's not needed for template expression parsing
- Loading branch information
1 parent
0cddde6
commit 273d19a
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
273d19a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make JSX parsing an opt-in.
It is known that JSX syntax is sometimes ambiguous with TS generics or casts
<>
.So when using JSX, some valid TS code doesn't parse, which is very annoying (if you're not using JSX).
I think using JSX inside a
script setup
, which is used along a<template>
, is unlikely so this shouldn't be the default behavior.If you want an example of real-world failures induced by JSX:
vuejs/eslint-plugin-vue#1223
EDIT: another argument to consider here is that we can add jsx support through
babelParserPlugins
, but we can't remove it.