millermedeiros / esformatter

ECMAScript code beautifier/formatter
MIT License
970 stars 91 forks source link

fix SwitchCaseColon when not immediately followed by another case #392

Closed stutrek closed 8 years ago

stutrek commented 8 years ago

The previous implementation of SwitchCaseColon only worked when the endToken of the node was ':', which is not always true.

This PR makes it look for the next ':' after the case node and applies the whitespace rules to it.

millermedeiros commented 8 years ago

thanks a lot for the PR! rebased and landed.