Skip to content

No Render Helper Functions

Suggestion
small-rules/no-render-helper-functions

Disallow non-component functions that return JSX or React elements.

Diagnostic Messages

noRenderHelper
Convert render helper '{{functionName}}' to a React component. Functions that return JSX should be PascalCase components, not camelCase helpers.

Configuration

This rule does not accept options.

{
"jsPlugins": [
"@pobammer-ts/small-rules"
],
"rules": {
"small-rules/no-render-helper-functions": "error"
}
}

Examples

Lowercase render helper
function createLabel() { return <div />; }
Named component function
function Component() { return <div />; }