Skip to content

jsx-indent fails with arrays #947

Closed
Closed
@lukeapage

Description

@lukeapage
export function X(props) {
    return (
        <div>
            {d &&
                [
                    <B key="1"/>,
                    <C
                        {...props}
                    />,
                ]
            }
        </div>
    );
}

The <C component is wanted both at indentation 16 (1 less than above) and at 20 - so it errors either way.

this is in my .eslintrc

"react/jsx-indent": ["error", 4],

The example works fine in 6.3.0 (I had avoided upgraded until ternaries worked a bit better).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions