Skip to content
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

Misinterprets closing tag when using Vue generic component #1938

Closed
Tsuyoshi84 opened this issue Jan 8, 2024 · 2 comments · Fixed by #1989
Closed

Misinterprets closing tag when using Vue generic component #1938

Tsuyoshi84 opened this issue Jan 8, 2024 · 2 comments · Fixed by #1989
Labels
A-linter Area - Linter C-bug Category - Bug

Comments

@Tsuyoshi84
Copy link

When using Vue generic component, oxc misinterprets the closing tag if using another generic inside the generic attribute.

Here is an example:

<script setup lang="ts" generic="T extends Record<string, string>">
defineProps<{ value: T }>()
</script>

In the above example, generic includes Record<string, string>. Since it has >, it looks like that oxc interprets that > as the closing tag of script.

Here is the result of oxlint:

❯ npx oxlint@latest

  × Unterminated string
   ╭─[src/components/Sample.vue:1:1]
 1 │ ">
   · ───
 2 │ defineProps<{ value: T }>()
   ╰────
@Dunqing
Copy link
Member

Dunqing commented Jan 8, 2024

It looks like the vue loader doesn't currently support the generic syntax.

@Dunqing Dunqing added C-bug Category - Bug A-linter Area - Linter labels Jan 8, 2024
@Boshen
Copy link
Member

Boshen commented Jan 8, 2024

I didn't know this is a thing.

We'll have to parse the html attributes now :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-bug Category - Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants