Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upUnexpected token = (null) on x = {} #756
Comments
This comment has been minimized.
This comment has been minimized.
|
You need to put the state of the react component inside the constructor that receive a props parameter then call the Here is an example: export default class App extends React.Component {
constructor (props) {
super(props)
this.state = {
aa: {},
bb: {},
cc: {},
}
}
render () {
return <div />
}
}Note you need to use |
This comment has been minimized.
This comment has been minimized.
|
Thanks, I know that but the team is using So there is no other way to ignore/skip this type? |
This comment has been minimized.
This comment has been minimized.
|
Ah well. I tried it out myself and yes this warning raise up. May it be that ESLint does not quite understand this feature yet? |
This comment has been minimized.
This comment has been minimized.
|
Thanks. Yeah, I think you're right, it is an ESLint issue. |
This comment has been minimized.
This comment has been minimized.
|
|
feross
closed this
Jan 23, 2017
This comment has been minimized.
This comment has been minimized.
p4bloch
commented
Feb 15, 2017
|
Proper link to what @feross mentions above: https://github.com/feross/standard#how-do-i-use-experimental-javascript-es-next-features |
mustafawm commentedJan 23, 2017
Hi,
I have the following in my code:
keep getting
Parsing error: Unexpected token = (null)on 3:9 (the=) even when I try to ignore the warning with// eslint-disable-lineor other forms of ignoring/hiding warning.Any advice on how to ignore/pass this error, as it's blocking StandardJS from scanning the rest of the file.