-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Description
The title is not very eloquent, so I'll explain what I'm after by example.
Currently you can only require parens around multiline jsx. I'd also like to require parens around single-line jsx, but only when it lives on its own line. This is particularly useful when within an arrow function.
For example, the following would raise an error:
foo.map((bar, baz) =>
<div>I'm on my own line!</div>
);
As would this:
const content =
<div>Hi there!</div>;
The following would not raise errors:
foo.map((bar, baz) => (
<div>I'm on my own line!</div>
));
const content = (
<div>Hi there!</div>;
);
const content = <div>Hi there!</div>;