Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Open
@qnp

Description

@qnp
Issue body actions

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.