vue/no-template-target-blank
eslint-plugin-vue
Suggestion
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-template-target-blank": "error",
},
},
];Disallow target="_blank" attribute without rel="noopener noreferrer"
<a href="http://example.com" target="_blank" >link</a>
</template> <a href="http://example.com" target="_blank" rel="noopener">link</a>
</template> <a href="http://example.com" target="_blank" >link</a>
</template><a href="http://example.com" target="_blank" rel="noopener noreferrer">link</a><a href="http://example.com" target="_blank" rel="noopener noreferrer">link</a><a href="http://example.com" target="_blank" rel="noopener">link</a>Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
vue/no-template-target-blank
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-template-target-blank": "error",
},
},
];Oxlint does not have this rule.
security/noBlankTarget
security · since 1.0.0
{
"linter": {
"rules": {
"security": {
"noBlankTarget": "error"
}
}
}
}Disallow the use of event names that collide with native web event names
Disallow usages that lose the reactivity of props passed to setup
Disallow using v-else-if/v-else on the same element as v-for