Skip to content
Advertisement

React typescript eslint error Parsing error: Unexpected token ! How to fix this?

So this is my index.tsx:

JavaScript

and this is my eslintrc.js:

JavaScript

i have tried to install babel-eslint, and add it like a parser? but it didin`t help

so here`s the question, how to solve the problem “error Parsing error: Unexpected token !”?

Advertisement

Answer

Set typescript-eslint as your parser by adding "parser": "@typescript-eslint/parser",.

https://typescript-eslint.io/docs/

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