correctness/noVoidTypeReturn
correctness · since 1.0.0
No autofixRecommended
biome.json
{
"linter": {
"rules": {
"correctness": {
"noVoidTypeReturn": "error"
}
}
}
}Disallow returning a value from a function with the return type 'void'
class A {
f(): void {
return undefined;
}
}const a = {
f(): void {
return undefined;
}
}function f(): void {
return undefined;
}class A {
f() {
return undefined;
}
}class B {
f(): void {}
}function f(): void {
return;
}Examples from the Biome documentation.
ESLint does not have this rule.
Oxlint does not have this rule.
correctness/noVoidTypeReturn
correctness · since 1.0.0
{
"linter": {
"rules": {
"correctness": {
"noVoidTypeReturn": "error"
}
}
}
}Disallow unnecessary String.raw function in template string literals without any escape sequence.
Disallow unnecessary escapes in string literals.
Prefer folder exclusions that prevent Biome from scanning the folder.