JSX Auto-format adds unnecessary space in attributes #8683
Labels
Bug
A bug in TypeScript
Domain: Formatter
The issue relates to the built-in formatter
Duplicate
An existing issue was already created
From @AlecBoutin on May 18, 2016 19:55
The .tsx/.jsx auto-formatter adds an unnecessary space on the end of certain dynamic attributes.
E.g.
<button id={fn()} />
becomes<button id={fn() } />
after the file is auto-formatted. A space is inserted after the closing parenthesis of the fn() call.The problem appears to be related to having parenthesis in the attribute.
E.g. <button id={""} /> is left unchanged by auto-format.
<button id={("")} />
becomes<button id={("") } />
(the space is inserted)I have also observed the auto-formatter preserves the spaces in the id attribute of
<button id={ ("") } />
Copied from original issue: microsoft/vscode#6498
The text was updated successfully, but these errors were encountered: