Closed abelnation closed 8 years ago
this is tricky to describe as integers... because right now whiteSpace.[before|after].UnaryExpressionOperator = 1
would convert !!foo
into ! ! foo
, which for some people might look weird... (this special case would need to be handled by a plugin)
the UpdateExpression
hook is very dumb right now, only removes line breaks and white spaces between the argument
and operator
- this is easy to fix and should be improved (we should add a new option UpdateExpressionOperator
)
I added the UpdateExpressionOperator
on 8937a94 - but we should probably add another way to handle the multiple consecutive UnaryExpressionOperator
(output !! foo
instead of ! ! foo
) - but not sure how to handle it, maybe always format like !! foo
or !!foo
and not add an option to format as ! ! foo
?
whiteSpace.after.UnaryExpressionOperator = 1
and whiteSpace['before'|'after''].UpdateExpressionOperator = 1
should do the trick!
I updated the UnaryExpressionOperator
behavior so input !!foo
will output !! foo
instead of ! ! foo
- which makes more sense and will probably match more style guides... If anyone needs a different behavior it's easy to implement as a plugin and/or add a new setting to esformatter (but I'll keep it simple for now)
thanks a lot for the bug reports and feature requests! please keep them coming.
Spacing between
++
operators and the variable it effects are not functioning correctly for me. The goal is to have spaces between the operator and the var.My config