The thing is, if I remove return and curly brackets I will have syntax error because of function short syntax.
(c: ChoiceType): ChoiceType => {
return { ...c, id: uniqid() };
}
Hi @idchlife, thanks for the issue. It looks like there's not enough information for us to know how to help you. If you're reporting a bug, please be sure to include:
eslint -v
)Requesting a new rule? Please see Proposing a New Rule for instructions.
If it's something else, please just provide as much additional information as possible. Thanks!
If you want to return an object you have to enclose it in parens
var foo = () => ({a: 1});
@alberto this is true. Despite this syntax, is it ok for linter to say that there is no need for a body when using return {}...
I'm sticking to 50/50, because of short functions syntax. Will checking of it and it's return value will change in future, or will it stay the same.
Most helpful comment
If you want to return an object you have to enclose it in parens