Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
IlyaSemenov opened this issue Nov 21, 2023 · 2 comments · Fixed by #2339
Closed

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

IlyaSemenov opened this issue Nov 21, 2023 · 2 comments · Fixed by #2339

Comments

@IlyaSemenov
Copy link

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

@FloEdelmann
Copy link
Member

Pull request is welcome 🙂

@FloEdelmann FloEdelmann changed the title Add allow list to vue/no-v-text-v-html-on-component Add allow option to vue/no-v-text-v-html-on-component Nov 30, 2023
@mitar
Copy link

mitar commented Mar 17, 2024

So how does one know if a component supports v-html and v-text?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants