Skip to content

Rule Proposal: vue/no-deprecated-router-link-tag-prop #1306

@TheAlexLichter

Description

@TheAlexLichter

Please describe what the rule should do:

Using the tag property for RouterLink or NuxtLink is usually a bad idea because it removes out-of-the-box accessibility (further: vuejs/router#148 (comment)). This rule should throw an error if people try to change the tag.

PS: The tag prop will be removed in future majors of vue-router.

What category should the rule belong to?

[ ] Enforces code style (layout)
[x] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)

Provide 2-3 code examples that this rule should warn about:

<template>
 <RouterLink tag="div" to="/">Home</RouterLink>
</template>
<template>
 <RouterLink :tag="someVariable" to="/">Home</RouterLink>
</template>
<template>
 <NuxtLink tag="div" to="/">Home</NuxtLink>
</template>

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