Skip to content

Require linebreaks in curly braces in JSX attributes and expressions to be consistent (react/jsx-curly-newline) #1372

Closed
@feross

Description

@feross

https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md

We want either both curly braces have a line break directly inside them, or no line breaks are present.

When consistent or { multiline: "consistent", singleline: "consistent" } is set, the following patterns are considered warnings:

<div>
  { foo
  }
</div>

<div>
  {
    foo }
</div>

<div>
  { foo &&
    foo.bar
  }
</div>

The following patterns are not warnings:

<div>
  { foo }
</div>

<div>
  {
    foo
  }
</div>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions