LYR-SEM0218
a 'return;' that ends a body
The last statement of a function's or a lambda's body is return;. Not said unless the lint is set to warn.
Explanation
A body ends after its last statement; a return; there says nothing more. The lint is allow by default.
Take it out.
Wrong
@Warn("needless-return")
fn main(): void {
let _ = 1;
return;
}
Right
@Warn("needless-return")
fn main(): void {
let _ = 1;
}