Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upThe first JSX property should always be placed on a new line if the JSX tag takes up multiple lines and there are multiple properties (react/jsx-first-prop-new-line) #696
Comments
feross
added
the
enhancement
label
Nov 22, 2016
This comment has been minimized.
This comment has been minimized.
|
IMO OK: // single-line
<Hello personal={true} />
// follows single-line, but with object spacing
<Hello foo={{
x: 1,
...
}} />
// still single-line with object spacing
<Hello bar foo={{
x: 1,
...
}} personal={true} />
// too many props on 1 line, therefore, like an object definition, go multi-line
<Hello
personal={true}
foo="bar"
/>Bad: <Hello
personal />
<Hello personal
prop />
<Hello personal={true}
foo="bar"
/>(so |
This comment has been minimized.
This comment has been minimized.
|
Yeah, that looks right @dcousens! |
This comment has been minimized.
This comment has been minimized.
|
Just ran the test suite. No errors, except on |
feross
added this to the
standard v11 milestone
Apr 4, 2017
feross
modified the milestones:
standard v12,
standard v13
Aug 28, 2018
feross
modified the milestones:
standard v13,
standard v14
Jul 5, 2019
feross
changed the title
Configure the position of the first property (jsx-first-prop-new-line)
The first JSX property should always be placed on a new line if the JSX tag takes up multiple lines and there are multiple properties (react/jsx-first-prop-new-line)
Aug 14, 2019
This comment has been minimized.
This comment has been minimized.
|
This will ship in |
feross
closed this
in
ee41ee9
Aug 14, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
feross commentedNov 22, 2016
Ensure correct position of the first property.
multiline-multiprop: The first property should always be placed on a new line if the JSX tag takes up multiple lines and there are multiple properties.https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md
I've personally run into this while working on WebTorrent Desktop and Brave with @dcposch, where we've been very inconsistent with this.