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

New rule suggestion: no-singleton-divs #148

Closed
pelotom opened this issue Mar 13, 2018 · 3 comments
Closed

New rule suggestion: no-singleton-divs #148

pelotom opened this issue Mar 13, 2018 · 3 comments

Comments

@pelotom
Copy link

pelotom commented Mar 13, 2018

<div>s without attributes and containing only a single child are usually useless and can be eliminated.

@pelotom pelotom changed the title New rule: no-singleton-divs New rule suggestion: no-singleton-divs Mar 13, 2018
@cheeZery
Copy link
Contributor

Imho you sometimes use div containers for styling purposes, e.g. when working with flexbox.

<div style={{ display: "flexbox", justifyContent: "space-between", height: "200px" }}>
    <div>foo</div>
    <div>bar</div>
</div>

How would you prevent using <div> in this example and what are other common use cases of useless <div>s?

@pelotom
Copy link
Author

pelotom commented Sep 16, 2018

@cheeZery this is certainly true, but IME pretty rare, and I’m happy to provide lint-disabling pragmas for the few cases where I need this.

@adidahiya
Copy link
Contributor

Closing due to deprecation timeline, see #210

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

No branches or pull requests

3 participants