我确实收到了一个standardJs lint错误
/lib/with-apollo-client.js:7:24: Parsing error: Unexpected token =对于这段代码,来自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) {
// ...
}
}
}这有什么错呢?我使用的是standardJs 11.0.1
发布于 2018-08-16 16:26:00
我相信这是因为你不能在没有转换的情况下以这种方式定义类属性:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Instance_properties
https://stackoverflow.com/questions/51872628
复制相似问题