JS.VUE.REQUIRE.RENDER.RETURN

Enforce render function to always return value

Rule Details

This rule aims to enforce render function to always return value

{'vue/require-render-return': ['error']}

Copy
<script>
export default {
  /* GOOD */
  render (h) {
    return h('div', 'hello')
  }
}
</script>

{'vue/require-render-return': ['error']}

Copy
<script>
export default {
  /* BAD */
  render (h) {
    if (foo) {
      return h('div', 'hello')
    }
  }
}
</script>

Options

Nothing.

Further Reading

  • Guide - Render Functions (https://v3.vuejs.org/guide/render-function.html)

The content on this page is adapted from the ESLint User Guide. Copyright © OpenJS Foundation and other contributors, www.openjsf.org. All rights reserved. https://eslint.org/docs/rules/