Summary:
Removes the `error-subclass-name` ESLint rule from `react-native/eslint-plugin`, and implements a new `require-extends-error` ESLint rule inside the React Native repository. This rule was only intended to be used for internal development of React Native.
This will change `react-native/eslint-plugin` to no longer provide the `error-subclass-name` rule.
NOTE: One behavior difference here is that I also implemented the desired behavior of checking classes that extend `Library.SomeError`.
Changelog:
[General][Removed] - `react-native/eslint-plugin` no longer provides the `error-subclass-name` rule.
Reviewed By: lunaleaps
Differential Revision: D39858882
fbshipit-source-id: 27b53216d77a15b3425bd9669dbc9d954c1c61da
Summary:
Moves the `no-haste-imports` ESLint rule into the React Native repository because it was only intended to be used for internal development of React Native.
This will change `react-native/eslint-plugin` to no longer provide the `no-haste-imports` rule.
Changelog:
[General][Removed] - `react-native/eslint-plugin` no longer provides the `no-haste-imports` rule.
Reviewed By: lunaleaps
Differential Revision: D39858883
fbshipit-source-id: b8d91ce5996b615341cf60c6f839afac1e26dac9
Summary:
Updates documentation in React Native to reference `main` (or `HEAD` for URLs) instead of `master`.
Part of https://github.com/facebook/react-native/issues/31788.
Changelog:
[General][Changed] - Update documentation reference from `master` to `main` or `HEAD`.
Reviewed By: JoshuaGross
Differential Revision: D29717128
fbshipit-source-id: 0b0babd8407c6fd3d0e5431f6eaf976059731d6f
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
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
Summary: Ports an internal ESLint rule used at Facebook, `error-subclass-name`, to cover the React Native codebase. This rule enforces that error classes ( = those 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.
Reviewed By: rubennorte
Differential Revision: D17829298
fbshipit-source-id: 834e457343034a0897ab394b6a2d941789953d2e
Summary:
This is an ESLint plugin that infers whether an import looks like a Haste module name. To keep the linter fast and simple, it does not look in the Haste map. Instead, it looks for uppercase characters in single-name import paths, since npm has disallowed uppercase letters in package names for a long time. There are some false negatives (e.g. "merge" is a Haste module and this linter rule would not pick it up) but those are about 1.1% of the module names in the RN repo, and unit tests and integration tests will fail anyway once Haste is turned off.
You can disable the lint rule on varying granular levels with ESLint's normal disabling/enabling mechanisms.
Also rewrote more Haste imports so that the linter passes (i.e. fixed lint errors as part of this PR).
## Changelog
[General] [Changed] - Add a lint rule to disallow Haste imports
Pull Request resolved: https://github.com/facebook/react-native/pull/25058
Differential Revision: D15515826
Pulled By: cpojer
fbshipit-source-id: d58a3c30dfe0887f8a530e3393af4af5a1ec1cac