React/JSX-curly-brace-presence is too strict
See original GitHub issueIn the case below:
<div css={`
background: #009688;
transition: background 0.5s;
`}>
Hello world!
</div>
The linter throws an error for using curly braces, but it’s impossible to have multi-line parameters without them, as the template literal notation (string
) requires curly braces to be used.
eslint --fix
produces the following result:
<div css="
background: #009688;
transition: background 0.5s;
">
Hello world!
</div>
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
ESLint rule: react/jsx-curly-brace-presence
This issue is to consider enabling the rule for react/jsx-curly-brace-presence in our eslint config. This could be set up to catch two ...
Read more >eslint-plugin-react - npm
jsx -curly-brace-presence, Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in ...
Read more >WebStorm, React & JSX curly braces autocomplete
I had a tough time finding the "Add for JSX attributes" option which was way under the "Other" tab in HTML. – Sayan....
Read more >curly - ESLint - Pluggable JavaScript Linter
JavaScript allows the omission of curly braces when a block contains only one statement. However, it is considered by many to be best...
Read more >Changelog - JavaScript Standard Style
We want using standard to be light and fun and so we're careful about making ... curly braces in JSX props and children...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In that case, please do file a new issue on the plugin repo 😃 Thanks!
(linking to https://github.com/yannickcr/eslint-plugin-react/issues/1592)