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.

Document recommended eslint config

See original GitHub issue

Not sure if this is intended or not, but I didn’t see anything in the documentation about it.

When using react-dom, it requires import of react even if react itself is never required. For example, in our project we have a backbone shim view that we use merely to render the page component:

ReactDOM.render(<SomePage/>, this.el);

No react-specific transform occurs on the page, however this fails because React is not available. I assume the problem here is the fact React.createElement is needed for the conversion from JSX to JS. While deduceable, this is not very intuitive. Also, this causes linters to fail on the import of React without actually using it anywhere. In both cases, I imagine not desirable behavior.

Any recommendations? I think at bare minimum this should be called out explicitly somewhere (and apologies if it already is and I just missed it).

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
awearycommented, Mar 20, 2017

@kkemple there may be some issues mentioned in https://github.com/facebook/react/issues/8035 that might be good to look at. We’d also appreciate any feedback on pending doc PRs!

1reaction
gaearoncommented, Mar 20, 2017

Not really, and I’m not sure where we would add it. Right now the issue is not as bad because we recommend Create React App for beginners, and it includes the necessary lint rules. So perhaps this is not really super important.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration Files - ESLint - Pluggable JavaScript Linter
ESLint supports adding shared settings into configuration files. Plugins use settings to specify the information that should be shared across all of its...
Read more >
ESLint Config for JavaScript Standard Style - GitHub
npx eslint --init · Select "Use a popular style guide." · Select "Standard." · Select a config file format. · If prompted, confirm...
Read more >
ESLint configuration - Codeac
ESLint requires configuration via a .eslintrc.* (for example .eslintrc.yml ) configuration file as detailed in ESLint's documentation. If you don't specify your ...
Read more >
Eslint Basic Configuration - Medium
The practical way ... Let's do some demo example of configuring ESLint for a simple project. ... This utility will walk you through...
Read more >
Intro to ESLint Config Files - Mastering JS
You can configure ESLint using either a .eslint.* file or an eslintConfig option in your package.json file. Your .eslint.* file may be either...
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