Skip to content

Add test in no-parsing-error for template type assertions #2082

Open
@qnp

Description

@qnp

What rule do you want to change?

no-parsing-error

Does this change cause the rule to produce more or fewer warnings?

Fewer errors.

How will the change be implemented? (New option, new default behavior, etc.)?

New default behavior.

Please provide some example code that this change will affect:

Any type assertion in templates. Here is a very naïve example:

<script setup lang="ts">
let x: string | number = 1
</script>

<template>
  {{ (x as number).toFixed(2) }}
</template>

What does the rule currently do for this code?

Parsing error: Unexpected token as

What will the rule do after it's changed?

No error.

Additional context

As stated by the official VueJS documentation, from which I took the above example, this syntax is valid.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions