Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 565 Bytes

jsx-alignment.md

File metadata and controls

27 lines (20 loc) · 565 Bytes

Pattern: Misaligned multi-line elements

Issue: -

Description

Enforces a consistent style for multi-line JSX elements which promotes ease of editing via line-wise manipulations as well as maintainability via small diffs when changes are made.

Example of incorrect code:

const element = <Tag className="test"
                 ~~~ [JSX attributes must be on a line below the opening tag]
                 tabIndex={1}
/>;

Example of correct code:

const element = <div
    className="test"
    tabIndex={1}
>
    {children}
</div>;