vuejs / vue-eslint-parser

The ESLint custom parser for `.vue` files.
MIT License
435 stars 74 forks source link

Generic definition with Generic Parameter Defaults in `<script setup lang="ts" generic="">` causes `"Parsing error: ';' expected.` after #220 #221

Closed danwithabox closed 5 months ago

danwithabox commented 5 months ago

Before You File a Bug Report Please Confirm You Have Done The Following...

What version of ESLint are you using?

8.56.0

What version of eslint-plugin-vue and vue-eslint-parser are you using?

What did you do?

Configuration I provide a stripped-down Vite project as the repro. Issue is configuration-independent, any valid TS+Vue config will cause this.
<script setup lang="ts" generic="STitle extends string | undefined = undefined, SSubtitle extends string | undefined = undefined">
</script>

What did you expect to happen?

No error on Ln 1, Col 68

image

What actually happened?

Error on Ln 1, Col 68

image

Link to Minimal Reproducible Example

https://github.com/danwithabox/issue_vue-eslint-parser_221

Additional comments

Generic Parameter Defaults in generic attribute.

Works in 9.4.0, fails in 9.4.1

When searching for the issue, I found https://github.com/vuejs/vue-eslint-parser/issues/217 to be similar. It seems to me, the fix for that, i.e. https://github.com/vuejs/vue-eslint-parser/pull/220 is probably the culprit.