Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing error: Unexpected token = null #931

Closed
webchaz opened this issue Jun 23, 2017 · 1 comment

Comments

@webchaz
Copy link

commented Jun 23, 2017

I'm using standard with standard-loader and babel-eslint parser in webpack.

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

In my .eslintrc I have

{
  "parser": "babel-eslint",
  "parserOptions": {
    "sourceType": "module",
    "allowImportExportEverywhere": false,
    "codeFrame": false
  },
  "plugins": ["react"]
}

However, I'm receiving this unexpected token for the static in the following block:

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 there's a config missing or how I can get standard to work with stage-0

@feross

This comment has been minimized.

Copy link
Member

commented Jun 23, 2017

I'm not sure how you would configure standard-loader to support stage-0. You should probably open an issue on that repo or ask @timoxley.

However, I see that you're using an .eslintrc file. standard doesn't look at those. If you want to pass options to the babel-eslint parser, try a .babelrc file?

@feross feross closed this Jun 23, 2017

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.