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-wrap-multiline does not check nested JSX #205

Closed
dagerikhl opened this issue Feb 14, 2019 · 2 comments · Fixed by #240
Closed

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

dagerikhl opened this issue Feb 14, 2019 · 2 comments · Fixed by #240
Labels
Formatting rule Relates to a rule which enforces code formatting and likely overlaps with prettier help wanted Type: Bug

Comments

@dagerikhl
Copy link

dagerikhl commented Feb 14, 2019

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!

@adidahiya adidahiya added the Formatting rule Relates to a rule which enforces code formatting and likely overlaps with prettier label Mar 12, 2019
@adidahiya
Copy link
Contributor

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

@dagerikhl
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Formatting rule Relates to a rule which enforces code formatting and likely overlaps with prettier help wanted Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants