Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsx-indent fails with arrays #947

Closed
lukeapage opened this issue Nov 7, 2016 · 1 comment
Closed

jsx-indent fails with arrays #947

lukeapage opened this issue Nov 7, 2016 · 1 comment
Labels

Comments

@lukeapage
Copy link
Contributor

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).

@lukeapage
Copy link
Contributor Author

It seems actually this can be fixed by putting the [ on the same line as {d &&

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants