ESLint: Parsing error: This experimental syntax requires enabling one of the following parser plugin(s): ‘jsx, flow, typescript’ (2:9)

Install @babel/preset-react in dev dependencies. Add this in .eslintrc file … “parser”: “@babel/eslint-parser”, “parserOptions”: { … “babelOptions”: { “presets”: [“@babel/preset-react”] }, } … Source: https://ffan0811.medium.com/error-debugging-this-experimental-syntax-requires-enabling-one-of-the-following-parser-plugin-s-22946599a0a4

Struggling with TypeScript, React, Eslint and simple Arrow Functions components

Ok, so I don’t know if it is the correct answer, but finally changing the settings in Eslint helped me to change the type of function for Components. I added the following rule to my .eslintrc.js file: “react/function-component-definition”: [ 2, { namedComponents: “arrow-function”, unnamedComponents: “arrow-function”, }, ], With this, eslint will ONLY accept arrow functions … Read more

tech