Skip to content

Format should indent JSX fragment children #20650

@mjbvz

Description

@mjbvz

TypeScript Version: 2.7.0-dev.20171208

Code

const frag = (
    <>
    <p>text</p>
    </>
)

Run Format

Expected behavior:
Child is indented:

const frag = (
    <>
        <p>text</p>
    </>
)

This is consistent with what we do for:

const frag = (
    <React.Fragment>
    <p>text</p>
    </React.Fragment>
)

Actual behavior:
No change. Child will be de-indented if it was previously indented

Metadata

Metadata

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions