Skip to content

No Use Of Empty Return Value

Error
small-rules/no-use-of-empty-return-value

Disallow using the return value of functions that do not return anything.

Diagnostic Messages

removeUseOfOutput
Remove this use of the output from "{{name}}"; "{{name}}" doesn't return anything.

Configuration

This rule does not accept options.

{
"jsPlugins": [
"@pobammer-ts/small-rules"
],
"rules": {
"small-rules/no-use-of-empty-return-value": "error"
}
}

Examples

Using void function result
function doWork() {
sideEffect();
}
const result = doWork();
Using returned value
function getValue() {
return 1;
}
const result = getValue();