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.

JSX References are not recognized

See original GitHub issue

Using eslint v1.3.1, when I check this file:

var Component = require('Component');
module.exports = <Component foo="bar" />;

I get the following output:

$ ./node_modules/.bin/eslint -c .eslintrc a.jsx

a.jsx
  1:1  warning  Use the global form of "use strict"    strict
  1:5  error    "Component" is defined but never used  no-unused-vars

✖ 2 problems (1 error, 1 warning)

Where “defined but never used” is obviously wrong.

Here’s my .eslintrc.

Possibly somehow related to https://github.com/babel/babel-eslint/issues/136.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
newswimcommented, May 26, 2016

I’m using the .yml config and had to add this line (surrounded with **'s):

extends: ['eslint:recommended', **'plugin:react/recommended'**]
0reactions
mik01ajcommented, Sep 2, 2015

Ah, you’re right! I’m sorry for all the hassle with this ticket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React JSX not being recognized? - Stack Overflow
The react library does not recognize jsx. You will need a library like babel to parse your jsx. – Farooq AR. Jul 21,...
Read more >
React Stripe.js reference | Stripe Documentation
The Stripe.js reference covers complete Elements customization details. ... This doc assumes that you already have a basic working knowledge of React and ......
Read more >
jsconfig.json Reference - Visual Studio Code
json file defined inside a workspace. You will want to do this so that the code in one project is not suggested as...
Read more >
SyntheticEvent - React
This reference guide documents the SyntheticEvent wrapper that forms part of ... These focus events work on all elements in the React DOM,...
Read more >
babel/preset-react
Automatic runtime (since v7.9.0 ) adds the functionality for these plugins automatically when the development option is enabled. If you have automatic runtime ......
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