← Back

vue/return-in-computed-property warning

Enforce that a return statement is present in computed property

Examples

❌  Incorrect

<script>
    export default {
        computed: {
            foo () {

            },
        },
    }
</script>

✅  Correct

<script>
    export default {
        computed: {
            foo () {
                return 'bar';
            },
        },
    }
</script>