vue/no-define-model-default
eslint-plugin-vue
No autofix
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-define-model-default": "error",
},
},
];<script setup>
const model = defineModel({ type: String, default: "" });
</script><script setup lang="ts">
const count = defineModel<number>("count", { default: 0 });
</script><script setup lang="ts">
const model = defineModel({ type: String, required: true });
const count = defineModel<number>("count");
</script>Examples from the Biome 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-define-model-default
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-define-model-default": "error",
},
},
];Oxlint does not have this rule.
nursery/noVueDefineModelDefault
nursery · since 2.6.8
{
"linter": {
"rules": {
"nursery": {
"noVueDefineModelDefault": "error"
}
}
}
}Disallow constant expressions in conditions in <template>
Disallow shorthand type conversions in <template>
Disallow passing multiple objects in an array to class
Require component name property to match its file name