4.4.22.3.0-dev.20170220Visual Studio Code as well as directly on the command-lineinterface testInterface {
"something": number;
}
[].map((e): testInterface => { return { "something": 1 }; });
'This arrow function body can be simplified by omitting the curly braces and the keyword 'return'. (arrow-return-shorthand)'
no warning as it cannot be simplified by omitting the curly bracers and the keyword 'return'.
Upon reading more about it, however, it turns out you can replace the return and bracers with regular parenthesis => ({ "something": 1 }) so only the warning message would need updating for this case.
Given the comment by @MrAndersen1 I think the warning can be enhanced to handle this type of return statement and suggest to also wrap the thing into brackets
I have to say, though, that wrapping the thing in parenthesis is not intuitive and doesn't look right - even though it may be.
I believe this has been fixed even though it says here that just 3 of 4 tasks are complete.
Most helpful comment
Given the comment by @MrAndersen1 I think the warning can be enhanced to handle this type of return statement and suggest to also wrap the thing into brackets