Skip to content

vue/no-restricted-html-elements

disallow specific elements

📖 Rule Details

This rule allows you to specify HTML, SVG, and MathML elements that you don't want to use in your application.

Now loading...

🔧 Options

This rule takes a list of strings, where each string is an element name to be restricted:

json
{
  "vue/no-restricted-html-elements": ["error", "a", "marquee"]
}
Now loading...

Alternatively, the rule also accepts objects.

json
{
  "vue/no-restricted-html-elements": [
    "error",
    {
      "element": ["a", "RouterLink"],
      "message": "Prefer the use of <NuxtLink> component"
    },
    {
      "element": "marquee",
      "message": "Do not use deprecated HTML tags"
    }
  ]
}

The following properties can be specified for the object.

  • element ... Specify the element name or an array of element names.
  • message ... Specify an optional custom message.

{ "element": "marquee" }, { "element": "a" }

Now loading...

🚀 Version

This rule was introduced in eslint-plugin-vue v8.6.0

🔍 Implementation