Skip to content

vue/no-template-target-blank

disallow target="_blank" attribute without rel="noopener noreferrer"

  • 💡 Some problems reported by this rule are manually fixable by editor suggestions.

📖 Rule Details

This rule disallows using target="_blank" attribute without rel="noopener noreferrer" to avoid a security vulnerability(see here for more details).

Now loading...

🔧 Options

json
{
  "vue/no-template-target-blank": ["error", {
    "allowReferrer": true,
    "enforceDynamicLinks": "always"
  }]
}
  • allowReferrer ... If true, does not require noreferrer.default false
  • enforceDynamicLinks ("always" | "never") ... If always, enforces the rule if the href is a dynamic link. default always.

{ allowReferrer: false } (default)

Now loading...

{ allowReferrer: true }

Now loading...
Now loading...
Now loading...

🚀 Version

This rule was introduced in eslint-plugin-vue v7.0.0

🔍 Implementation