Skip to content

[feat] config to allow <></> in no-useless-fragment #1265

@sbdchd

Description

@sbdchd

Problem Description

Sometimes APIs will type their inputs as JSX.Element, in which case, you’ll need to pass in an empty fragment instead of null.

<Foo bar={<></>}/>

Or the return type of the component is typed as JSX.Element so you return <></> while loading

Alternative Solutions

Migrating away from <></> is too much work

Feature Details

allowEmptyFragment: boolean = false

Examples

allowEmptyFragment: true

And then you could use <></>

Evaluation Checklist

  • I have had problems that this feature would solve
  • I could not find a way to solve the problem with existing features or workarounds
  • I have thought very hard about potential edge cases and downsides, and they are acceptable
  • I think the feature is well-defined and would provide clear value to users

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions