eslint-plugin-react
eslint-plugin-react copied to clipboard
Add note about not needing jsx-no-undef with TS / typescript-eslint
Hi @ljharb, hope everything is going well! 👋
Quick PR to add an additional 2 cases of when to not use react/jsx-no-undef
-
when using TypeScript, since it has better checks than ESLint
no-undefrules -
the
@typescript-eslint/parserparser allows for usage of ESLint's built-inno-undefwithoutreact/jsx-no-undef:- https://typescript-eslint.io/play/#ts=5.7.2&fileType=.tsx&code=DwCQpgNhD2AEB2BDAtmAvAIgFLQBbw1gHoA%2BAbgCgg&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQHYHsBaWXAE0QDN0pFpp9pJwwBfEFoA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false
This applies to:
.tsxfiles (as demonstrated in the typescript-eslint Playground link).jsxor.jsfiles - also without"allowJs": trueor"checkJs": trueintsconfig.json.