Skip to content

JSX Auto-format adds unnecessary space in attributes #8683

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

Closed
dbaeumer opened this issue May 19, 2016 · 2 comments
Closed

JSX Auto-format adds unnecessary space in attributes #8683

dbaeumer opened this issue May 19, 2016 · 2 comments
Labels
Bug A bug in TypeScript Domain: Formatter The issue relates to the built-in formatter Duplicate An existing issue was already created

Comments

@dbaeumer
Copy link
Member

From @AlecBoutin on May 18, 2016 19:55

  • VSCode Version: 1.1

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

@dbaeumer dbaeumer self-assigned this May 19, 2016
@mhegazy mhegazy added Bug A bug in TypeScript Domain: Formatter The issue relates to the built-in formatter labels May 19, 2016
@mhegazy mhegazy added this to the Community milestone May 19, 2016
@mhegazy mhegazy added the Help Wanted You can do this label May 19, 2016
@evansb
Copy link
Contributor

evansb commented May 20, 2016

Duplicate of #6716

@mhegazy
Copy link
Contributor

mhegazy commented May 23, 2016

indeed a duplicate of #6716. thanks.

@mhegazy mhegazy closed this as completed May 23, 2016
@mhegazy mhegazy added Duplicate An existing issue was already created and removed Help Wanted You can do this labels May 23, 2016
@mhegazy mhegazy removed this from the Community milestone May 23, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: Formatter The issue relates to the built-in formatter Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants