Files
react-native/packages/eslint-plugin-react-native
Alex HuntandFacebook GitHub Bot 2410fc97b7 Reorganise dev tooling/debugging modules as src/private/devsupport/ (#50730)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50730

This is a consolidation of our "dev support" features in the `src/private/` dir.

New grouping:

- `src/private/devsupport/`
    - `devmenu/` — The Dev Menu and in-app inspection features (in-app UI)
        - `elementinspector/` — The Element Inspector overlay (panel with sub-features), accessed from  Dev Menu → Toggle Element Inspector
        - `perfmonitor/` — The Perf Monitor overlay, accessed from Dev Menu → Show Perf Monitor
    - `rndevtools/` — Modules supporting React Native DevTools (external UI)

`NativeReactDevToolsRuntimeSettingsModule.js` and `NativeReactDevToolsSettingsManager.js` are also moved out of `specs_DEPRECATED/`.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D73031559

fbshipit-source-id: 952a469f31f4cd05aeed27dc7023552e723ca078
2025-04-17 09:43:48 -07:00
..

@react-native/eslint-plugin

This plugin is intended to be used in @react-native/eslint-config. You probably want to install that package instead.

Installation

yarn add --dev eslint @react-native/eslint-plugin

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):

{
    "plugins": ["@react-native"]
}

Rules

platform-colors

Enforces that calls to PlatformColor and DynamicColorIOS are statically analyzable to enable performance optimizations.

Testing

To run the tests in this package, run the following commands from the React Native root folder:

  1. yarn to install the dependencies. You just need to run this once
  2. yarn jest packages/eslint-plugin-react-native.