react-native/packages/eslint-config-react-native
Alex Hunt 4afc47a588 Revert to @babel/eslint-parser in eslint-config (#47333)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47333

Motivated by https://github.com/facebook/hermes/issues/1549. This was originally changed in https://github.com/facebook/react-native/pull/46696, as our internal Flow support had diverged from `babel/eslint-parser` (https://github.com/facebook/react-native/issues/46601).

We effectively have three flavours of JavaScript in support:
- Flow@latest for the `react-native` package, shipped as source — uses `hermes-parser`.
- TypeScript for product code (community template, Expo) — uses `babel/plugin-syntax-typescript`.
- Plain JavaScript or Flow in product code, *which may be extended with additional user Babel plugins and needs lenient parsing* — uses `babel/plugin-syntax-flow` via `babel/eslint-parser` (**this change**).

I'd love to simplify this 😅.

Switching to `hermes-eslint` for the RN monorepo codebase (D63541483) is unchanged.

Changelog: [Internal]

Reviewed By: robhogan, cipolleschi

Differential Revision: D65272156

fbshipit-source-id: 3a2bbe3fcf8ed6057f6d994a0be4985e6bf46fa9
2024-11-01 05:31:37 -07:00
..
index.js Revert to @babel/eslint-parser in eslint-config (#47333) 2024-11-01 05:31:37 -07:00
package.json Revert to @babel/eslint-parser in eslint-config (#47333) 2024-11-01 05:31:37 -07:00
README.md

@react-native/eslint-config

Version

Installation

yarn add --dev eslint prettier @react-native/eslint-config

Note: We're using yarn to install deps. Feel free to change commands to use npm 3+ and npx if you like

Usage

Add to your eslint config (.eslintrc, or eslintConfig field in package.json):

{
    "extends": "@react-native"
}