UNPKG

eslint-plugin-reblend

Version:

Reblend specific linting rules for ESLint

42 lines (31 loc) • 938 B
# Enforce ES5 or ES6 class for returning value in render function (`reblend/require-render-return`) šŸ’¼ This rule is enabled in the ā˜‘ļø `recommended` [config](https://github.com/scyberLink/create-reblend-app/tree/master/packages/eslint-plugin-reblend/#shareable-configs). <!-- end auto-generated rule header --> When writing the `render` method in a component it is easy to forget to return the JSX content. This rule will warn if the `return` statement is missing. ## Rule Details Examples of **incorrect** code for this rule: ```jsx var Hello = createReblendClass({ render() { <div>Hello</div>; }, }); class Hello extends Reblend.Component { render() { <div>Hello</div>; } } ``` Examples of **correct** code for this rule: ```jsx var Hello = createReblendClass({ render() { return <div>Hello</div>; }, }); class Hello extends Reblend.Component { render() { return <div>Hello</div>; } } ```