-1

I created a new react app with npx create-react-app my-app2, and then cd my-app2. But when run this command npm start, it shows

Failed to compile

enter image description here.

And the localhost:3000 shows

Error while loading rule 'jsx-a11y/alt-text': rule.create is not a function Occurred while linting H:\MyApps\my-app2\src\index.js

enter image description here

How to solve this problem?

KoalaJ
  • 145
  • 2
  • 11
  • Here you ll find your answer https://stackoverflow.com/questions/69424343/eslint-configuration-error-when-saving-my-code – DVN-Anakin Nov 10 '21 at 08:51
  • You're not the only person asking about this today: https://stackoverflow.com/q/69910080/3001761. – jonrsharpe Nov 10 '21 at 08:54

2 Answers2

1

Try deleting 'node_modules' folder and 'package-lock.json' file. Then run 'npm i'. This worked for me.

  • Thank you for your suggestion, Petri. I haven't tried it, because the problem came from eslint-plugin-jsx-a11y and a latest release has fixed it, so I went directly to install it. And it works. – KoalaJ Nov 10 '21 at 23:53
0

I solved this problem. The latest version 6.5.1 of eslint-plugin-jsx-a11y was released 6 hours ago. I installed it, and this problem is solved!

You'll first need to install ESLint:

npm install eslint --save-dev

or

yarn add eslint --dev

Then, install eslint-plugin-jsx-a11y:

npm install eslint-plugin-jsx-a11y --save-dev

or

yarn add eslint-plugin-jsx-a11y --dev

Please check the details in https://github.com/jsx-eslint/eslint-plugin-jsx-a11y.

KoalaJ
  • 145
  • 2
  • 11