Skip to content
Advertisement

eslint Parsing error: Unexpected token =

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:

JavaScript

eslint error:

JavaScript

.eslintrc.js file:

JavaScript

Advertisement

Answer

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:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement