palantir / tslint-react

:orange_book: Lint rules related to React & JSX for TSLint.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsx-wrap-multiline does not check nested JSX

dagerikhl opened this issue · comments

Possible duplicate of #185, but I couldn't quite understand what error that issue was reporting.

When using the rule jsx-wrap-multiline = true, no nested JSX is checked. The outer JSX is checked correctly, but no insertion of JS in the JSX via {} is checked. Example:

const myCondition = true;
const component = () => (
    <div>
        I am correctly wrapped in () and don't report an error.

        {myCondition && <div>
            I should, but I don't report an error.
        </div>}

        {myCondition && (<div>
            I don't report an error either.
        </div>)}

        {myCondition
            ? <div>
                Neither do I.
            </div>
            : <div>
                Nor me.
            </div>
        }
    </div>
);

I would expect any nested JSX inside {} tags to also be checked with this rule.

Hope this can be addressed, as it's a common pattern in many of our/my projects :)

Keep up the great work with TSLintReact<3!

Probably a bug, but formatting rules are low priority because of palantir/tslint#4534

Perfectly understandable. Great if it gets fixed, but I understand if it won't at this time. Thanks!