Hi, there!
I’ve done some searching before posting and I’m almost sure that this is a lint thing from Glitch’s editor, but just to make sure and to know if there’s any solution to it I’m posting it here.
I’m getting Parsing Error: Unexpected Token = at the first line in a React Component. The project works fine, so it’s probably a lint error, however I didn’t find any solution to fix it. I’m still pretty new to JavaScript and React, btw.
Class fields are still in the experimental state, and ESLint doesn’t natively support experimental features. This can be addressed by adding a plugin or custom parser to ESLint, but unfortunately Glitch’s linting isn’t fully configurable right now and plugins are one of the things that’s not available yet, so there’s no way to configure the built-in linting to ignore those errors. Sorry for the bother!
We plan to improve linting in Glitch and to make it more configurable, but I don’t have a timeline for that work yet. There are a few topics in the https://support.glitch.com/c/feature-ideas category around linter improvements, but I don’t think there’s anything for this - please feel free to create and vote for one to help us understand what folks would like us to work on.
Make a .eslintrc.json in the root of your directory.
{ "parser": "babel-eslint" }
Then go to your package.json file (if you don’t have you, re-create your project with the express or sqlite template, or find out how to convert your package to use a package.json some other way.)
Add the package ‘babel-eslint’. Next open the ‘Terminal’ via the UI and run the command refresh. That worked for me anyway. Good luck