-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
insertNewLineAroundBlocks
interprets inline conditions as a "block"
#47
Comments
insertNewLineAroundBlocks
interprets inline conditions as a "block"
There are actually a type of Block regarding the Stylus compiler. Hence, this is not really a bug from Stylus Supremacy, unless people want an exception. |
This is also a simple variable assignment, so the question is which one wins over. :-) In my experience these sort of lines will be sitting in the middle of other variable assignments, and the resulting breakup patterns will look surprising and out of character compared to the rest of the formatting. I'd say that if the line starts with |
Well, it doesn't matter if the statement starts with $var = 123 if ($xxx)
if ($xxx) {
$var = 123
} |
I see, so even if from the human developer's end there's a difference, the parser can't see the difference? How come then does the formatter retain the single-line syntax and doesn't normalize it into if ($xxx) {
$var = 123
} ? |
If
insertNewLineAroundBlocks
option istrue
then this block of variable assignments:gets broken up as if the
if
andunless
conditions are blocks of their own, like so:Which is a bit surprising and can turn ugly quite fast.
The text was updated successfully, but these errors were encountered: