I am working with create-react-app + typescript + eslint application and during build have such error:
Line 1:8: \'React\' was used before it was defined @t
This has been resolved in 4.4.0. Upgrade these dependencies to version 4.4.0
Update: This may work for some use cases. This resolved my issue.
"@typescript-eslint/eslint-plugin": "^4.4.0",
"@typescript-eslint/parser": "^4.4.0",
I deleted packages @typescript-eslint/eslint-plugin
and @typescript-eslint/parser
from my package.json
,
deleted node_modules
and package-lock.json
,
reinstalled packages: npm install
The error disappeared.
UPDATE
After that create-react-app uses their own @typescript-eslint/eslint-plugin
module which is deprecated.