-
-
Notifications
You must be signed in to change notification settings - Fork 239
no-unused-vars, no-undef errors in simple ES6 class / react example #21
Comments
I'm getting that error for all classes |
specifically classes are "defined but never used" warning is coming up |
+1 Got the same errors regarding "defined but never used" |
Also having this problem. I have a module that exports a class ( |
This seems to dupe #8. |
Can you please verify that this issue still exists on 3.0.1? |
I'm still seeing this with However, when using |
Confirmed still seeing this issue with |
I am also seeing this issue with |
Similar to @cemckinley, I'm seeing this with
9:8 error Route is defined but never used no-unused-vars
9:15 error NotFoundRoute is defined but never used no-unused-vars
9:30 error DefaultRoute is defined but never used no-unused-vars
9:44 error Link is defined but never used no-unused-vars
9:50 error RouteHandler is defined but never used no-unused-vars
55:44 error Handler is defined but never used no-unused-vars
✖ 6 problems (6 errors, 0 warnings) My
|
eh? is that a solution? I stopped noticing the errors when I included the react-plugin, but haven't worked on anything this week. |
Yup, it's the solution. Use the eslint-plugin-react rules if you're using JSX. It can't really be fixed on the |
It seems the eslint react plugin fixes this error, but it exists outside of react projects. Something as simple as
Will produce this error, it doesn't have to extend a React component. Pulling in the eslint react plugin to solve the issue when I'm not using react seems like a lazy work around. |
Can you reproduce with the regular parser, maybe an eslint issue. But, if you export the class it should be fixed. |
I'm running into this issue with a regular ES6 class. |
Yes, me too. I am using the class only in the ReactDOM.render() method. I wonder if this bug was reintroduced in the last upgrade. For the time being I had to disable the "no-unused-vars" rule. |
Can one of you please open a new bug with an example and the according eslintrc file. Thanks. |
Hi, sorry for not answering before, I will do it :) |
I investigated the bug and it seems to be an eslint issue. I still have the same problem if I use: |
In case it can help someone, my issue was resolved here: eslint/eslint#6303 |
index_es6.js (using the react 0.13 syntax)
eslint output (using eslint-babel):
index_es5.js
eslint output (using eslint-babel):
Is this an issue or am I doing something stupid here?
The text was updated successfully, but these errors were encountered: