Issue
Having any character after a multi-line template expression in a vue template causes the formatter to add empty lines to the expression and the check mode always fails.
Reproduction Example
Good
<template>
<div>
{{
(
something.something.very.long.code ??
fail("this is even longer to enforce multiple lines")
).toUpperCase()
}}
</div>
</template>
stays like this when running ./node_modules/.bin/oxfmt .
./node_modules/.bin/oxfmt --check . does not report any error
Bug
<template>
<div>
{{
(
something.something.very.long.code ??
fail("this is even longer to enforce multiple lines")
).toUpperCase()
}}.
</div>
</template>
note the . immediately after the }} of the template expression.
./node_modules/.bin/oxfmt --check . now fails on this file.
When now executing ./node_modules/.bin/oxfmt . the new output is:
<template>
<div>
{{
(
something.something.very.long.code ??
fail("this is even longer to enforce multiple lines")
).toUpperCase()
}}.
</div>
</template>
and with each execution another line is added. So after 5 executions it looks like:
<template>
<div>
{{
(
something.something.very.long.code ??
fail("this is even longer to enforce multiple lines")
).toUpperCase()
}}.
</div>
</template>
./node_modules/.bin/oxfmt --check . fails on all of the examples.
Issue
Having any character after a multi-line template expression in a vue template causes the formatter to add empty lines to the expression and the check mode always fails.
Reproduction Example
Good
stays like this when running
./node_modules/.bin/oxfmt ../node_modules/.bin/oxfmt --check .does not report any errorBug
note the
.immediately after the}}of the template expression../node_modules/.bin/oxfmt --check .now fails on this file.When now executing
./node_modules/.bin/oxfmt .the new output is:and with each execution another line is added. So after 5 executions it looks like:
./node_modules/.bin/oxfmt --check .fails on all of the examples.