-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrap Stateless JSX Arrow Functions and Assignment in Parens (fixes pa…
…rt of #73)
- Loading branch information
1 parent
31a07fe
commit d91a28e
Showing
6 changed files
with
233 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const comp1 = ( | ||
<div style={styles} key="something"> | ||
Keep the wrapping parens. | ||
</div> | ||
); | ||
|
||
const comp2 = <div style={styles} key="something"> | ||
Create wrapping parens. | ||
</div>; | ||
|
||
comp2A = <div style={styles} key="something"> | ||
Create wrapping parens. | ||
</div>; | ||
|
||
const comp3 = <div style={styles} key="something">Bump to next line without parens</div>; | ||
|
||
const comp4 = <div style={styles} key="something">Create wrapping parens and indent <strong>all the things</strong>.</div>; | ||
|
||
const comp5 = <div>Keep it on one line.</div>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const render1 = ({ styles }) => ( | ||
<div style={styles} key="something"> | ||
Keep the wrapping parens. Put each key on its own line. | ||
</div> | ||
); | ||
|
||
const render2 = ({ styles }) => <div style={styles} key="something"> | ||
Create wrapping parens. | ||
</div>; | ||
|
||
const render3 = ({ styles }) => <div style={styles} key="something">Bump to next line without parens</div>; | ||
|
||
const render4 = ({ styles }) => <div style={styles} key="something">Create wrapping parens and indent <strong>all the things</strong>.</div>; | ||
|
||
const render5 = ({ styles }) => <div>Keep it on one line.</div>; | ||
|
||
const notJSX = (aaaaaaaaaaaaaaaaa, bbbbbbbbbbb) => this.someLongCallWithParams(aaaaaa, bbbbbbb).anotherLongCallWithParams(cccccccccccc, dddddddddddddddddddddd) |