0

I do get an standardJs lint error

/lib/with-apollo-client.js:7:24: Parsing error: Unexpected token =

for this snippet, which is from https://github.com/zeit/next.js/blob/canary/examples/with-apollo/lib/with-apollo-client.js

import initApollo from './init-apollo'
import Head from 'next/head'
import { getDataFromTree } from 'react-apollo'

export default (App) => {
  return class Apollo extends React.Component {
    static displayName = 'withApollo(App)' // <-
    static async getInitialProps (ctx) {
    // ...
    }
  }
}

What is wrong with that? I'm using standardJs 11.0.1

user3142695
  • 15,844
  • 47
  • 176
  • 332

1 Answers1

0

I believe this is because you cannot define class properties in this way without a transform:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Instance_properties

OliverRadini
  • 6,238
  • 1
  • 21
  • 46