jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.97k stars 515 forks source link

requireShorthandArrowFunctions should not fire for functions that do not return #2196

Closed fluky closed 8 years ago

fluky commented 8 years ago

Probably just needs a new option for requireShorthandArrowFunctions.

Consider the case:

() => { return something; }

This should trigger. But

() => { something (); }

Should not trigger.

The reason is that the latter returns undefined instead of the result of something which could have a different effect in the code calling the function.

markelog commented 8 years ago

At this point only major and CST related bugs will be fixed.