Comments (11)
I also had issues with this after eslint 0.17. It seems we should install eslint-plugin-react
as explained in eslint/eslint#2147.
With the following:
$ npm -g ls eslint eslint-plugin-react babel-eslint
/usr/local/lib
├── [email protected]
├── [email protected]
└── [email protected]
And adding the following to my .eslintrc
{
...
"plugins": [
"react"
],
...
"rules": {
...
"react/jsx-uses-vars": 1
}
}
I no longer get the false warning
from babel-eslint.
Working .eslintrc
from the subdirectory containing my JSX:
{
"rules": {
"no-extra-parens": 0,
"react/jsx-uses-vars": 1
},
"ecmaFeatures": {
"jsx": true,
},
"env": {
"node": false,
"browser": true,
"es6": true,
},
"parser": "babel-eslint",
"plugins": [
"eslint-plugin-react"
]
}
@sebmck, if you keep getting hassled about JSX e.g. #74, might be worth including some extra notes in the README
.
from babel-eslint.
+1, I also have this.
from babel-eslint.
Most of these are easy fixes my laptop shit itself so I won't be able to
fix these for a couple of hours while I get a charger...
On Saturday, 28 February 2015, Dan Abramov [email protected] wrote:
+1, I also have this.
Reply to this email directly or view it on GitHub
#5 (comment).
Sebastian McKenzie
from babel-eslint.
Fixed as of 1.0.8, thanks!
from babel-eslint.
sorry but version 1.0.8 of what package? I'm using eslint version 0.17.1 and babel-eslint 2.0.2, I'm facing the same problem. My .eslintrc file looks like this:
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
},
"rules": {
"quotes": [2, "single", "avoid-escape"],
"comma-dangle": [2, "always-multiline"],
"strict": [2, "never"],
"new-cap": [2, { "capIsNewExceptions": ["Router", "Schema"] }],
"camelcase": [0],
"consistent-return": [0]
}
}
from babel-eslint.
I think I'm having this problem as well.
.eslintrc
{
"parser": "babel-eslint",
"rules": {
"strict": false,
"no-console": false,
"no-multiple-empty-lines": false
},
"env": {
"mocha": true,
"browser": true,
"node": true
}
}
problem-example.jsx
var Foo = require('./Foo.jsx')
module.exports = <Foo></Foo>
Sublime Text console
SublimeLinter: eslint output:
<text>: line 1, col 4, Error - Foo is defined but never used (no-unused-vars)
<text>: line 2, col 18, Error - 'Foo' is not defined. (no-undef)
terminal
$ npm ls -g babel-eslint eslint
/Users/cesarandreu/.nvm/versions/io.js/v1.6.1/lib
├── [email protected]
└── [email protected]
As part of the Sublime Text console output it also shows it's using the correct eslint binary.
from babel-eslint.
I've got a similar config and I'm seeing the issue of all the JSX used vars show as not used.
Main difference is [email protected].
➜ ~/github/react-starter-kit (master u=) npm -g ls eslint eslint-plugin-react babel-eslint
/usr/local/lib
├── [email protected]
├── [email protected]
├── [email protected]
└─┬ [email protected] (git://github.com/feross/standard#4a2d51eb527bec1a987af9dae57ec8d1d61decaa)
├── [email protected] (git://github.com/eslint/eslint.git#06927eeacba776c29a40bc0a191f9d9fc9575ba6)
└── [email protected]
from babel-eslint.
Hi all, I'm still getting this error, would anyone mind a look here? https://stackoverflow.com/questions/45085584/how-to-remove-eslint-parsing-error-on-es6-export-statement?noredirect=1#comment77144342_45085584
npm v3.10.10
node v6.11.0
eslint v4.2.0
from babel-eslint.
A figured it out, it was the last comment here : #6
from babel-eslint.
https://github.com/babel/babel-eslint#known-issues
from babel-eslint.
Related Issues (20)
- Latest Babel + flow generates "is not defined" errors on star imports HOT 3
- npm WARN [email protected] requires a peer of @babel/core@>=7.2.0 but none is installed HOT 3
- Disabling eslint on file does not work HOT 2
- Using decorator syntax doesn't pass eslint HOT 7
- There are no release notes for 10.1.0 HOT 2
- Imports from sibling directory not parsed using babel config HOT 2
- 11.0.0-beta.2 - Private method is not defined. (eslintno-undef) HOT 7
- eslint returns with parsing error unexpected token HOT 4
- How to use babel-eslint in a non-node JS environment (such as client environment, browser) HOT 6
- Breaking change in Node 13.13 HOT 2
- Typescript: parsing error when using "readonly" in interface HOT 2
- Expected indentation is forced for comments as well HOT 1
- Question: `11.0.0-beta2` Not installing all babel plugins (top level await) HOT 1
- no-unused-vars false positive with typescript types HOT 2
- Feature idea: have a way for eslint-plugin-prettier to share an AST with eslint HOT 4
- Missing 'ImportExpression' in visitorKeys HOT 4
- `RegExpLiteral` is not converted to `Literal` in an edge case HOT 2
- Template-literal rule attempting to run on nullish coalescing operations, and then crashing eslint HOT 1
- Error on 'extends' operator on generic type HOT 1
- works for me HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-eslint.