Babel-eslint: Decorators are marked as unused variables

Created on 12 Mar 2016  路  9Comments  路  Source: babel/babel-eslint

Using eslint 2.4.0 I'm seeing an issue with decorators where the following tells me a variable isn't used:

import Radium from 'radium';

@Radium
export default class Something extends Component {
 /* ... */
}

My .eslintrc:

{
  "extends": "eslint-config-airbnb",
  "env": {
    "node": true,
    "browser": true,
    "mocha": true,
  },

  "globals": {
    "__PRODUCTION__": true,
    "__DEV__": true,
    "__CLIENT__": true,
    "__SERVER__": true
  },

  "plugins": [
    "promise"
  ],

  "parser": "babel-eslint",

  "rules": {
      "promise/param-names": 2,
      "promise/always-return": 2,
      "promise/always-catch": 2
  }
}

Most helpful comment

@johanneslumpe Seems the issue is still reproducible with [email protected] though some other verion-related issues are gone now. At least I'm still facing it with [email protected]. Mind checking it and reopen the issue if present?

All 9 comments

Yeah I guess this is just an issue with babel-eslint not being compatible with eslint 2.4.0. Closing as that is already a know issue.

@johanneslumpe Seems the issue is still reproducible with [email protected] though some other verion-related issues are gone now. At least I'm still facing it with [email protected]. Mind checking it and reopen the issue if present?

I'm experiencing this issue as well. ESLint 3.19.0, babel-eslint 8.0.0

Ditto on ESlint 4.11.0 and 8.0.2.

Try to install ESlint globally, it works for me with v4.14.0

npm i -g eslint

I am having same issue with "standard": "^10.0.3" // "babel-eslint": "^8.2.1",

+1

Reverting to babel-eslint 8.0.2 fixed this for me.

npm i eslint@latest

works for me on these versions 馃憤

"babel-eslint": "^8.2.2",
"eslint": "^4.19.1"
Was this page helpful?
0 / 5 - 0 ratings