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

Rule suggestion: no unneeded <React.Fragment> or <> #198

Closed
dikujepsen opened this issue Jan 23, 2019 · 1 comment · Fixed by #245
Closed

Rule suggestion: no unneeded <React.Fragment> or <> #198

dikujepsen opened this issue Jan 23, 2019 · 1 comment · Fixed by #245

Comments

@dikujepsen
Copy link

Sometimes I see programmers on my team using the React.Fragment or <> component around a single child, such as a div, in which case I think it might as well be deleted.

<React.Fragment>
    <div>
        <Component1 />
        <Component2 />
        <Component3 />
    </div>
</React.Fragment>

Would it be possible to make a rule that enforces this?

@adidahiya
Copy link
Contributor

I would call it react-no-unnecessary-fragment

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

Successfully merging a pull request may close this issue.

2 participants