How to start HTML tag in new line after save file?

During coding in React I have:

return (<div className="main" style={styles.main} > );

and I want after Ctrl+Alt+L ( reformat code )

return (
        <div className="main" style={styles.main} >
);

How should I change settings in Webstorm?

0
6 comments

Enabling New line after '(' and Place ')' on new line for Binary expressions in Settings | Editor | Code Style | JavaScript | Wrapping and Braces should do the thing

0

Like here?

Doesn't work :( 

0

It has to be Binary expressions, not Function declaration parameters

0

OK :) Thx. But have another questions. 
All html tags are equal in left.
<div>

<p>

</p>

</div>

How I can reformat it like this?

   <div>

        <p>

        </p>

   </div>

0

Works fine for me:

Do you have div listed in he Do not Indent Children Of list in Settings | Editor | Code Style | HTML | Other

0

No, I haven't. 

0

Please sign in to leave a comment.