I'm using:
- React 16.2.0
- Standard 10.0.3
- Babel ES Lint 8.2.3
- @babel/plugin-proposal-class-properties 7.0.0-beta.40
- VS Code
I have this in my package.json
:
"standard": {
"parser": "babel-eslint"
}
I'm writing my React components like:
class MyComponent extends React.Component {
static propTypes = {}
static defaultProps = {}
myMethod = () => {}
render () {}
}
I'm seeing these errors:
'propTypes' is not defined. (no-undef)
'defaultProps' is not defined. (no-undef)
'myMethod' is not defined. (no-undef)
These errors are winding me up every time I open a component file!
How do I either make ES Lint recognise these class properties as valid, or tell ES Lint to ignore them..?