vue/valid-define-options
eslint-plugin-vue
No autofixRecommended
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/valid-define-options": "error",
},
},
];<script setup>
defineOptions() // no options object
defineOptions({ name: 'A' })
defineOptions({ name: 'B' }) // multiple calls
defineOptions({ props: { msg: String } }) // use `defineProps()` instead
</script><script setup>
defineOptions({ name: 'foo', inheritAttrs: false })
</script>Examples from the Oxlint documentation.
vue/valid-define-options
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/valid-define-options": "error",
},
},
];vue/valid-define-options
vue plugin · correctness
{
"plugins": [
"vue"
],
"rules": {
"vue/valid-define-options": "error"
}
}nursery/useVueValidDefineOptions
nursery · since 2.6.5
{
"linter": {
"rules": {
"nursery": {
"useVueValidDefineOptions": "error"
}
}
}
}Enforce valid defineEmits compiler macro
Enforce valid defineProps compiler macro
Enforce that a return statement is present in emits validator
Enforce valid nextTick function calls
Enforce that a return statement is present in computed property
Disallow element's child contents which would be overwritten by a directive like v-html or v-text