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
Closed

Parsing error: Unexpected token = null #931

webchaz opened this issue Jun 23, 2017 · 1 comment

Comments

@webchaz
Copy link

webchaz 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
Copy link
Member

feross 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 as completed 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.
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants