vue/no-undef-directives
eslint-plugin-vue
No autofix
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-undef-directives": "error",
},
},
]; <div v-foo></div>
</template> <div v-foo></div>
</template>
<script>
import vFocus from './vFocus';
export default {
directives: {
focus: vFocus
}
}
</script><input v-focus><input v-focus> <div v-foo></div>
</template>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-undef-directives
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-undef-directives": "error",
},
},
];Oxlint does not have this rule.
nursery/noVueUndeclaredDirectives
nursery · since 2.5.14
{
"linter": {
"rules": {
"nursery": {
"noVueUndeclaredDirectives": "error"
}
}
}
}Disallow target="_blank" attribute without rel="noopener noreferrer"
Disallow the use of event names that collide with native web event names
Disallow using v-else-if/v-else on the same element as v-for
Disallow usages that lose the reactivity of props passed to setup
Disallow unnecessary concatenation of literals or template literals in <template>