Skip to content

Commit

Permalink
Add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Jervis committed Nov 15, 2023
1 parent 46246f1 commit 903a845
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .changeset/strange-rings-explode.md
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

0 comments on commit 903a845

Please sign in to comment.