react-native-macos/packages/eslint-plugin-react-native-...
Luna Wei 3c2fb72541 Bump version of @react-native-community/eslint-plugin to 1.2.0
Summary:
Changelog: [Internal] Bump react-native-community/eslint-plugin

It looks like we `*` version on the package.json so no updates needed, published 1.2.0: https://www.npmjs.com/package/react-native-community/eslint-plugin

Reviewed By: cortinico, neildhar

Differential Revision: D35590075

fbshipit-source-id: 11402cedea3067018c03e7b59202a48dc3a6b084
2022-04-20 13:19:43 -07:00
..
__tests__ Remove lint restricting properties on `DynamicColorIOS` (#33182) 2022-02-25 06:46:14 -08:00
BUCK Move error-subclass-name lint rule to GitHub 2019-10-09 11:48:07 -07:00
README.md RN: Replace `master` with `main` in Documentation 2021-07-15 15:22:57 -07:00
error-subclass-name.js Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
index.js Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
no-haste-imports.js Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
package.json Bump version of @react-native-community/eslint-plugin to 1.2.0 2022-04-20 13:19:43 -07:00
platform-colors.js Remove lint restricting properties on `DynamicColorIOS` (#33182) 2022-02-25 06:46:14 -08: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.