window.setTimeout(() => alert(50), 0);
with tslint.json configuration:
{
"rules": {
"no-void-expression": true
}
}
no-void-expression because alert returns void.
No error.
UPDATE: posting the solution in the following comment, you can ignore this...
I have a workaround but it does't solve the issue. When using a function that returns void:
.subscribe( something => someFunction(something));
no-voidexpression rule alerts that someFunction(something) returns void. Tried to type it but it keeps launching the error. The only workaround I found is to use curly brackets:
.subscribe( something => { someFunction(something); });
works fine, but i'd like to use it without the curly brackets.
Finally have a solution!!! Add the following line in your tslint.json to allow arrow functions shorthand:
"no-void-expression": [true, "ignore-arrow-function-shorthand"],
Yup! Duplicate of #2473.
Most helpful comment
Finally have a solution!!! Add the following line in your
tslint.jsonto allow arrow functions shorthand: