Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
136
rated 0 times [  140] [ 4]  / answers: 1 / hits: 18121  / 7 Years ago, sun, june 18, 2017, 12:00:00

Why is eslint throwing this error? The Javascript runs without issue inside of React Native. The code was taken from the react-navigation example at : https://reactnavigation.org/docs/intro/



Javascript:



static navigationOptions = { header: null };


eslint error:



error  Parsing error: Unexpected token =


.eslintrc.js file:



module.exports = {
extends: standard,
plugins: [
react,
react-native
]
};

More From » reactjs

 Answers
7

The syntax is not yet standardised, but a stage-2 proposal for inclusion in Javascript (see Class Fields on https://github.com/tc39/proposals).



Try adding the following option above extends in your .eslintrc.js:



parser: babel-eslint,

[#57396] Friday, June 16, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
savanar

Total Points: 237
Total Questions: 105
Total Answers: 99

Location: Wales
Member since Mon, May 17, 2021
3 Years ago
;