Skip to content

Add allow option to vue/no-v-text-v-html-on-component #2321

Closed
@IlyaSemenov

Description

@IlyaSemenov

What rule do you want to change?

vue/no-v-text-v-html-on-component

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

No (by default).

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

New option to white list the list of components for which this rule doesn't apply, something like:

"vue/no-v-text-v-html-on-component": [
  "error",
  { allow: ["router-link", "nuxt-link"] }
]

Please provide some example code that this change will affect:

<template>
  <router-link to="/page" v-html="knowinglySafeHtmlComingFromServer" />
</template>

What does the rule currently do for this code?

Currently, the rule always disallows v-text/v-html on custom components.

What will the rule do after it's changed?

It will allow to use v-text/v-html on custom elements that are known to support them.

Additional context

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