Skip to content

jsx-wrap-multiline does not check nested JSX #205

@dagerikhl

Description

@dagerikhl

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Formatting ruleRelates to a rule which enforces code formatting and likely overlaps with prettierType: Bughelp wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions