artboost / router5-react-redux

router5 example usage, in an isomorphic React app, with Redux.
MIT License
11 stars 2 forks source link

Static class properties and eslint #1

Closed aksel closed 5 years ago

aksel commented 6 years ago

Static class properties are caught by the linter. E.g.

class Foo extends React.Component {
  static propTypes = { bar: PropTypes.string }; <--- Eslint parsing error: Unexpected token =
}

I can't for the life of me figure this out.

Something goes wrong in the linter configuration. It seems to be missing the transform-class-properties plugin, but it should be part of the babel preset I'm using

This is a minor annoyance, but any help is greatly appreciated.

aksel commented 6 years ago

Almost a year later, encountered this bug again somewhere else.

This fixes the issue

sumitngupta commented 5 years ago

:+1: just hit the same issue. Adding the babel-eslint package and setting as the parser in the eslintrc worked.