-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8856ac
commit 0036d4e
Showing
1 changed file
with
28 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
'eslint-config-seek': minor | ||
--- | ||
|
||
Adds [react/jsx-curly-brace-presence][docs] as an error. | ||
This removes unnecessary braces around strings in props and children. | ||
|
||
It also enforces braces around expressions in props and children. | ||
|
||
[docs]: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md | ||
|
||
### Examples | ||
|
||
```diff | ||
// Unecessary braces around string prop | ||
- <Column width={'content'}> | ||
+ <Column width="content"> | ||
``` | ||
```diff | ||
// Unecessary braces around string child | ||
- <Text>{'Hello'}</Text> | ||
+ <Text>Hello</Text> | ||
``` | ||
```diff | ||
// Mandatory braces around prop expression | ||
- <Button icon=<IconSearch />> | ||
+ <Button icon={<IconSearch />}> | ||
``` |