Skip to content

multiline generic definition in <script setup lang="ts" generic=""> cause "Parsing error: ';' expected. eslint". #217

Closed
@pronitsateli731

Description

@pronitsateli731

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

  • I'm using eslint-plugin-vue.
  • I'm sure the problem is a parser problem. (If you are not sure, search for the issue in eslint-plugin-vue repo and open the issue in eslint-plugin-vue repo if there is no solution.
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

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

In reproduction, I use tsconfig.json and .eslintrc.cjs which were created by "npm init vue@latest".

<script setup lang="ts" generic="
  /** definition of data in FormContext */
  TDefinitionOfFormContext extends Record<string, unknown>,
  /** Output of FormContext */
  TOutputOfFormContext,
  /** Vee Validate Path of whole this component */
  TObjectArrayFieldPath extends Path<TDefinitionOfFormContext>,
  /** Row data type */
  TItemValue extends Item<PathValue<TDefinitionOfFormContext, TObjectArrayFieldPath>>
">
  // import and code
</script>

What did you expect to happen?

No error. For example, in .ts file multiline generic definition cause no error, which is indicated in this picture.
スクリーンショット 2024-01-19 130734

What actually happened?

Parsing error: ';' expected. eslint
スクリーンショット 2024-01-19 130803
スクリーンショット 2024-01-19 130825

Link to Minimal Reproducible Example

https://github.com/pronitsateli731/vue-parser-report-r60119

Actually happened:

  • src/components/ObjectArrayField.vue
  • src/components/PeopleDetailItemRow.vue

Expect to Happen (TypeScript File)

  • src/components/useObjectArrayField.ts

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions