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.

no-extra-parens and react

See original GitHub issue

“no-extra-parens” throws error on this code:

return (
  <div>
    Hello
  </div>
);

How I can fix this? v1.0.0-rc-1

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:37 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
fernandopasikcommented, Jun 11, 2016

Using return has been attended but seems that when saving jsx into a variable still throws error with no-extra-parents.

var routes = ( //eslint-disable-line no-extra-parens
  <Route name='app' path='/' handler={Root}>
    <DefaultRoute handler={ConfigScreen} />
    <Route name='play' handler={PlayScreen} />
  </Route>
)
1reaction
btmillscommented, Nov 2, 2017

@plonko the React plugin has a rule to do that!

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-extra-parens - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Configuring ESLint with Webpack and React | by David Kerr
Eslint will work without this, but I would encourage customizing rules for your project. Here is a basic config file for react@16 ....
Read more >
Need fix for EsLint error: Gratuitous parentheses around ...
Need fix for EsLint error: Gratuitous parentheses around expression-no-extra-parens · 1. Then remove the parentheses to conform to the rule? · 1.
Read more >
ValidateJavaScript - Online Tool to Find & Fix JavaScript Errors
... tool that will automatically find basic errors and help prevent potentially destructive bugs in JavaScript & JSX (React.js) code. ... no-extra-parens
Read more >
eslint-config-vkbansal | Yarn - Package Manager
React /JSX. This package also includes a shareable config to be used with React or JSX . Just add this to your .eslintrc...
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