Skip to content

JSX formatting #8663

@asvetliakov

Description

@asvetliakov

Not sure if it has been reported yet, tried to find similar issues but didn't find anything.

TypeScript Version:

1.9.0-dev.20160518-1.0

Code

// A self-contained demonstration of the problem follows...
<div name="test"
     data="test"
     onClick={() => { }}
>
  <div>test</div>
</div>

Expected behavior:
Same as in example

Actual behavior:

<div name="test"
    onClick={() => { } }
    data="test"
    >
    <div>test</div>
</div>
  1. Attributes need to aligned and take indentation from top attribute (name)
  2. Closing tag indentation is a bit strange - any way to make it have same indentation level as opening one?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: FormatterThe issue relates to the built-in formatterFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions