Fix @react-native/eslint-config linting of jsx files

Summary:
`react-native/eslint-config` enables rules for TypeScript and `.js` files (as Flow), but seems to completely no-op if you have a `.jsx` file. Enabling it in an override leads to syntax errors because the config has not been enlightened on how to parse JSX.

This would normally happen if a config extended `plugin:react/recommended`, but we are already cutomizing the React plugin rules. So we instead just directly set `ecmaFeatures: {jsx: true}` as reccomended by https://github.com/jsx-eslint/eslint-plugin-react.

Changelog:
[General][Breaking] - Fix react-native/eslint-config linting of jsx files

Reviewed By: rickhanlonii

Differential Revision: D41654962

fbshipit-source-id: 778da0928fadb86caa6a33254379d3d7dd394892
This commit is contained in:
Nick Gerleman
2022-12-01 12:10:46 -08:00
committed by Facebook GitHub Bot
parent 07c8854a1c
commit 59ee573527
@@ -14,6 +14,9 @@ module.exports = {
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
extends: ['plugin:prettier/recommended'],
@@ -46,6 +49,9 @@ module.exports = {
'ft-flow/use-flow-type': 1,
},
},
{
files: ['*.jsx'],
},
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',