no-void
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"no-void": "error",
},
},
];void foo
void someFunction();
const foo = void bar();
function baz() {
return void 0;
}void foo;
void someFunction();Examples from the ESLint documentation.
no-void
eslint
export default [
{
rules: {
"no-void": "error",
},
},
];no-void
eslint plugin · restriction
{
"rules": {
"no-void": "error"
}
}complexity/noVoid
complexity · since 1.0.0
{
"linter": {
"rules": {
"complexity": {
"noVoid": "error"
}
}
}
}Disallow assignment operators in return statements
Disallow specified global variables
Enforce variables to be declared either together or separately in functions
Require using Error objects as Promise rejection reasons