filmov
tv
error ESLint Parsing error: Unexpected token:. react js cofiguration settings
Показать описание
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"
}
}
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"
}
}