react-native-macos/packages/eslint-plugin-react-native-...
Eli White 78266b8b54 Bump eslint-plugin-react-native-community version to 1.1.0
Summary:
This release will include the new platform-colors rule.

Changelog: [Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: cpojer

Differential Revision: D21022163

fbshipit-source-id: 65c831b3c820e44f75631b935118b043180ab3c7
2020-04-14 19:21:17 -07:00
..
__tests__ Remove ColorAndroid function as it adds no value over PlatfromColor (#28577) 2020-04-09 18:40:31 -07:00
BUCK Move error-subclass-name lint rule to GitHub 2019-10-09 11:48:07 -07:00
README.md Bump eslint-plugin-react-native-community version to 1.1.0 2020-04-14 19:21:17 -07:00
error-subclass-name.js Move error-subclass-name lint rule to GitHub 2019-10-09 11:48:07 -07:00
index.js Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` (#28398) 2020-03-27 23:02:15 -07:00
no-haste-imports.js Add a lint rule to disallow Haste imports (#25058) 2019-05-30 07:45:16 -07:00
package.json Bump eslint-plugin-react-native-community version to 1.1.0 2020-04-14 19:21:17 -07:00
platform-colors.js Remove ColorAndroid function as it adds no value over PlatfromColor (#28577) 2020-04-09 18:40:31 -07:00

README.md

eslint-plugin-react-native-community

This plugin is intended to be used in @react-native-community/eslint-plugin. 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.