Require expressions of type void to appear in statement position.
void refers to a function return that is meant to be ignored. Attempting to use a void-typed value, such as having it assigned to a variable, provided as a function argument, or returned from a function, can be misleading.
// code-linter.json5
{
"rules": {
"@typescript-eslint/no-confusing-void-expression": "error"
}
} export function func(): void {
return console.info('no return');
}
console.info(func()); plugin:@typescript-eslint/all
For details about how to configure Code Linter check rules, see Code Linter.