question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React/JSX-curly-brace-presence is too strict

See original GitHub issue

In 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:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ljharbcommented, Dec 10, 2017

In that case, please do file a new issue on the plugin repo 😃 Thanks!

0reactions
ljharbcommented, Dec 10, 2017
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found