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).
🔧 Options
json
{
"vue/no-template-target-blank": ["error", {
"allowReferrer": true,
"enforceDynamicLinks": "always"
}]
}
allowReferrer
... Iftrue
, does not require noreferrer.defaultfalse
enforceDynamicLinks ("always" | "never")
... Ifalways
, enforces the rule if the href is a dynamic link. defaultalways
.
{ allowReferrer: false }
(default)
{ allowReferrer: true }
{ "enforceDynamicLinks": "always" }
(default)
{ "enforceDynamicLinks": "never" }
🚀 Version
This rule was introduced in eslint-plugin-vue v7.0.0