-
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
Ben Jervis
committed
Nov 15, 2023
1 parent
46246f1
commit 903a845
Showing
1 changed file
with
26 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,26 @@ | ||
--- | ||
'eslint-config-seek': patch | ||
--- | ||
|
||
Prevents the new curly-brace-presence rule from affecting children. | ||
|
||
In the previous version, [react/jsx-curly-brace-presence][brace rule] was added to the eslint rules. | ||
This was primarily intended to catch unnecessarily using braces around string props. | ||
|
||
```diff | ||
- <Stack space={'medium'}> | ||
+ <Stack space="medium"> | ||
``` | ||
|
||
Because of the configuration we provided, this had the unintended side effect of removing curly braces inside child text that were being used to prevent the [unescaped entities rule]. | ||
|
||
```diff | ||
- <Text>The available props are {'"up"'} and {'"down"'}</Text> | ||
+ <Text>The available props are "up" and "down"</Text> | ||
// This is now an unescaped entity error | ||
``` | ||
|
||
To fix this, the curly brace rule will now ignore children, and only alert on prop values. | ||
|
||
[brace rule]: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md | ||
[unescaped entities rule]: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md |