standard-loader
standard-loader copied to clipboard
Parsing error: Unexpected token = null
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?
how are you configuring your babel presets?
Did you yarn add babel-eslint?