John Smith
John Smith

Reputation: 4353

JSX formatting in WebStorm - indentation

Consider this JSX expression:

return <><p>Some text</p><p><strong>Some more text!</strong></p></>;

Currently, upon pressing Ctrl+Alt+L WebStorm says it's already properly formatted.

Please tell me how to introduce automatic indentation of every tag based on nesting, as shown here:

return <>
    <p>Some text</p>
    <p>
        <strong>Some more text!</strong>
    </p>
</>;

Upvotes: 0

Views: 383

Answers (1)

lena
lena

Reputation: 93738

JSX formatting is configured in Settings | Editor | Code Style | HTML; please try removing p from Don't break if inline content and strong - from Inline elements list on Other tab

Upvotes: 2

Related Questions