mirror of
https://github.com/facebook/react-native.git
synced 2024-11-22 06:29:46 +00:00
4afc47a588
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 |
||
---|---|---|
.. | ||
index.js | ||
package.json | ||
README.md |
@react-native/eslint-config
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"
}