Typescript: Provide Format Options for JSX/TSX End of Tag Placement

Created on 28 Nov 2016  ·  1Comment  ·  Source: microsoft/TypeScript

From https://github.com/Microsoft/vscode/issues/16018 @VanishingDante

For the following JSX/TSX code:

<div
    >
    <img
        />
</div>

The current formatting settings do nothing. There does not seem to be a way to control how the ending > is placed on lines.

We would like an additional formatting setting so that we can format the above code as:

<div>
    <img />
</div>

This formatting option would be helpful for elements with many attributes.

Formatter Suggestion VS Code Tracked help wanted

Most helpful comment

If this gets implemented, please consider formatting the end of tag token to align with the start of the tag as per the jsx-alignment lint rule.

>All comments

If this gets implemented, please consider formatting the end of tag token to align with the start of the tag as per the jsx-alignment lint rule.

Was this page helpful?
0 / 5 - 0 ratings