react-native-macos/packages/eslint-plugin-react-native-...
Adam Gleitman 554ba2e4ea Merge in 0b68f3cf77 and a4757d2823 (finally!) 2021-08-31 13:00:36 -07:00
..
__tests__ Merge in 0b68f3cf77 and a4757d2823 (finally!) 2021-08-31 13:00:36 -07:00
BUCK Move error-subclass-name lint rule to GitHub 2019-10-09 11:48:07 -07:00
README.md Merge from upstream through 2020-04-24 (#803) 2021-07-21 15:24:02 -07:00
error-subclass-name.js Move error-subclass-name lint rule to GitHub 2019-10-09 11:48:07 -07:00
index.js v0.63 sync from upstream (#613) 2020-09-30 18:38:06 +02:00
no-haste-imports.js Merge react-native 0.61-stable (#323) 2020-04-28 11:49:15 -07:00
package.json Merge from upstream through 2020-04-24 (#803) 2021-07-21 15:24:02 -07:00
platform-colors.js Merge from upstream through 2020-04-24 (#803) 2021-07-21 15:24:02 -07:00

README.md

eslint-plugin-react-native-community

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

Installation

yarn add --dev eslint @react-native-community/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-community"]
}

Rules

error-subclass-name

NOTE: This rule is primarily used for developing React Native itself and is not generally applicable to other projects.

Enforces that error classes ( = classes with PascalCase names ending with Error) only extend other error classes, and that regular functions don't have names that could be mistaken for those of error classes.

no-haste-imports

Disallows Haste module names in import statements and require() calls.

platform-colors

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