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 upRequire shorthand form for JSX fragments (react/jsx-fragments) #1364
Comments
feross
added
enhancement
accepted
labels
Aug 15, 2019
feross
added this to the standard 14 milestone
Aug 15, 2019
feross
closed this
in
93027d9
Aug 15, 2019
This comment has been minimized.
This comment has been minimized.
|
Shipping this in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
feross commentedAug 15, 2019
In JSX, a React fragment is created either with <React.Fragment>...</React.Fragment>, or, using the shorthand syntax, <>...</>. This rule allows you to enforce one way or the other.
It will enforce the shorthand syntax for React fragments, with one exception. [Keys or attributes are not supported by the shorthand syntax][short_syntax], so the rule will not warn on standard-form fragments that use those.
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
The following pattern is considered a warning:
The following patterns are not considered warnings: