vue/return-in-computed-property
eslint-plugin-vue
No autofixRecommended
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/return-in-computed-property": "error",
},
},
];Enforce that a return statement is present in computed property
<script>
export default {
computed: {
foo() {
// missing return
}
}
}
</script><script>
export default {
computed: {
foo() {
return this.bar
}
}
}
</script>Examples from the Oxlint documentation.
vue/return-in-computed-property
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/return-in-computed-property": "error",
},
},
];vue/return-in-computed-property
vue plugin · correctness
{
"plugins": [
"vue"
],
"rules": {
"vue/return-in-computed-property": "error"
}
}nursery/useVueComputedPropertyReturn
nursery · since 2.6.5
{
"linter": {
"rules": {
"nursery": {
"useVueComputedPropertyReturn": "error"
}
}
}
}Enforce properties of $slots to be used as a function
Enforce that a return statement is present in emits validator
Enforce render function to always return value
Enforce valid defineEmits compiler macro
Require prop type to be a constructor
Enforce valid defineOptions compiler macro