Closed vwong closed 1 year ago
This is a known limitation of the htmljs parser, specifically that these top level statements are terminated by unbracket enclosed newlines.
Making this change to follow operators on the next line would cause code like the following to break:
export const x = "hi"
.myclass
Currently parses as:
export const x = "hi";
<div class="myclass"></div>
but if we followed expressions it'd confusingly be:
export const x = "hi".myclass;
Either way the fact that prettier is outputting something that is incompatible with what Marko can parse is definitely a problem. I've created a fix for that over here https://github.com/marko-js/prettier/pull/40
Version
5.5.0
Details
I have this line in my
icons.marko
file:Consumers of this can import the
IconType
and everything works correctly.When I run
prettier
through this, it gets reformatted to:Still looks like valid code, but I now get compile errors.