You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The root cause, IMO, is that vue-template-compiler in 'condense' mode doesn't strip all the space between the opening tag and the text indent level, or the end of the text and the closing tag. Perhaps another mode should be added that would strip all whitespace up to the first non-whitespace character if the whitespace includes a newline. (this could cause problems with long form prose, but it can be worked around the same way as in JSX -- interpolate a whitespace character {{' '}}).
Because of how 'condense' works, this lint rule is fine if all children are themselves elements, but it requires changes to actual output when the first/last child are text nodes or interpolations, which is kind of an overreach for a lint rule, especially for one enabled by default.
Perhaps it's completely intentional that Vue always has the same behavior as HTML instead of JSX, in which case these rules should also have an exception for text content / interpolations instead of only for tag names.
The text was updated successfully, but these errors were encountered:
Tell us about your environment
Please show your full configuration:
What did you do?
What did you expect to happen?
Applying the lint change (eslint --fix) should cause no visual changes to output DOM.
What actually happened?
The rule has ignore settings for specific tags (
pre
andtextarea
by default), but that completely ignores that this is a problem with any inline element; and because of CSSdisplay
any element can be inline. There is a difference between a<span> foo </span>
and<span>foo</span>
.The root cause, IMO, is that
vue-template-compiler
in'condense'
mode doesn't strip all the space between the opening tag and the text indent level, or the end of the text and the closing tag. Perhaps another mode should be added that would strip all whitespace up to the first non-whitespace character if the whitespace includes a newline. (this could cause problems with long form prose, but it can be worked around the same way as in JSX -- interpolate a whitespace character{{' '}}
).Because of how
'condense'
works, this lint rule is fine if all children are themselves elements, but it requires changes to actual output when the first/last child are text nodes or interpolations, which is kind of an overreach for a lint rule, especially for one enabled by default.Perhaps it's completely intentional that Vue always has the same behavior as HTML instead of JSX, in which case these rules should also have an exception for text content / interpolations instead of only for tag names.
The text was updated successfully, but these errors were encountered: