Files
react-native/packages/eslint-plugin-react-native-community
Vince Picone 4a97791341 Fix eslint-plugin README.md (#29337)
Summary:
The `eslint-plugin` package intent notice at the top of the README mistakenly refers to itself, it should instead refer to `react-native-community/eslint-config`

## Changelog
[Internal] [Fixed] - Fix typo in `eslint-plugin` README

Pull Request resolved: https://github.com/facebook/react-native/pull/29337

Test Plan: 1. ensure link works properly

Reviewed By: GijsWeterings

Differential Revision: D22493834

Pulled By: cpojer

fbshipit-source-id: 16b8173d3c2add7a85e142eac4ab36aef685062b
2020-07-14 06:07:39 -07:00
..
2020-05-29 02:53:36 -07:00
2020-07-14 06:07:39 -07:00

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.