Closed JonathanWolfe closed 8 years ago
we don't have this setting yet! logic is handled by https://github.com/millermedeiros/esformatter/blob/master/lib/hooks/ArrowFunctionExpression.js
I also considered adding a new setting to handle empty blocks/arrays/objects (see #220)
PS: I would accept a pull request that basically just checks if node.startToken
is (
and next non-empty token is )
; and calls limit.after(node.startToken, 0)
.. - but having a new option would be awesome.
I've tried this a couple different ways since you responded and I can't get it to work.
I'm hoping it has something to do with me testing using atom-esformatter and I haven't actually gone crazy.
this was indeed pretty hard to solve. I only figured it after running:
GREP=custom/arrow DEBUG=rocambole:ws:* npm test
and realizing that the ExpressionOpeningParentheses
and ExpressionClosingParentheses
whitespace was overriding the ParameterList
mutations... (took me almost 1h to figure it out)
thanks a lot for the bug report! I would probably not find this edge-case anytime soon.
Maybe I'm just missing it, but I can't figure out a setting to remove spaces from inside arrow function that don't have any parameters.
Current output (using default settings):
Desired output: