standard / standard-loader

webpack loader for linting your code with https://github.com/feross/standard
ISC License
68 stars 18 forks source link

Parsing error: Unexpected token = null #85

Open webchaz opened 7 years ago

webchaz commented 7 years ago

I created an issue here: https://github.com/standard/standard/issues/931

However, it seems this may be related to standard-loader. When running standard --parser babel-eslint the code checks out fine. However, when running through webpack, with the following config:

      {
        enforce: 'pre',
        test: /\.jsx?$/,
        loader: 'standard-loader',
        exclude: /(node_modules|bower_components)/,
        options: {
          error: false,
          snazzy: true,
          parser: 'babel-eslint'
        }
      },

This returns the following error: Parsing error: Unexpected token = null for the static in the following code:

export default class SelectDropdown extends React.Component {
  static propTypes = {
    selected: PropTypes.object.isRequired,
    onChange: PropTypes.func.isRequired,
    data: PropTypes.arrayOf(PropTypes.shape({
      key: PropTypes.string.isRequired,
      label: PropTypes.string.isRequired
    }).isRequired).isRequired
  }

Any idea if I'm missing something?

timoxley commented 7 years ago

how are you configuring your babel presets?

RyanWarner commented 7 years ago

Did you yarn add babel-eslint?