error ESLint Parsing error: Unexpected token:. react js cofiguration settings

preview_player
Показать описание
If ESLint isn’t configured to handle the specific syntax or language you're using (e.g., TypeScript, JSX, or modern ES6+ features), it will throw this error.

JS
--

npm install --save-dev @babel/eslint-parser

{
"parserOptions": {
"ecmaVersion": 2021, // Or the latest ECMAScript version you're using
"sourceType": "module" // For ES6 modules
}
}


Typescript
----------

npm install --save-dev @typescript-eslint/parser

Update your .eslintrc
{
"parserOptions": {
"ecmaVersion": 2021,
"sourceType": "module"
}
}
Рекомендации по теме