Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 605 Bytes

wrap-multilines.md

File metadata and controls

33 lines (26 loc) · 605 Bytes

Prevent missing parentheses around multilines JSX (wrap-multilines)

Wrapping multilines JSX in parentheses can improve readability and/or convenience.

Rule Details

The following patterns are considered warnings:

var Hello = React.createClass({
  render: function() {
    return <div>
      <p>Hello {this.props.name}</p>
    </div>;
  }
});

The following patterns are not considered warnings:

var singleLineJSX = <p>Hello</p>

var Hello = React.createClass({
  render: function() {
    return (
      <div>
        <p>Hello {this.props.name}</p>
      </div>
    );
  }
});