Граф коммитов

7 Коммитов

Автор SHA1 Сообщение Дата
Rubén Norte 7c36d0b6a0 Specify command to regenerate bundled sort-imports ESLint rule
Summary: Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D40138586

fbshipit-source-id: 2d593f6064680beec810ee608852895fdfff4f3b
2022-10-06 09:40:09 -07:00
Tim Yung 4363626701 RN: Enforce `flow-typed` Signatures
Summary:
Creates a new `valid-flow-typed-signature` ESLint rule that validates the `flow-typed` signatures at the top of each file.

This lint rule will discourage contributors from locally forking the `flow-typed` definitions. Instead, any changes should be submitted as patches to the upstream definition in: https://github.com/flow-typed/flow-typed

Changelog:
[Internal]

Reviewed By: rickhanlonii

Differential Revision: D39868721

fbshipit-source-id: e5e3ffe7568dbe52c9b598b53110b0fcbcad3e38
2022-09-30 14:28:48 -07:00
Tim Yung 868be00d8c RN: Create Portable `sort-imports` ESLint Rule
Summary:
Introduces a portable bundle that implements the `sort-imports` ESLint rule that we use internally at Meta, to the React Native repository.

As a consequence of the rapid changes that occur to this rule internally (and the desire to minimize red tape for Meta engineers), the portable bundle is built with Rollup with a lot of context omitted.

Changelog:
[Internal]

Reviewed By: skinsshark

Differential Revision: D39907799

fbshipit-source-id: 58fb6dc08030f20ac02c0e3fd1b175e22e4d74c0
2022-09-30 14:28:48 -07:00
Tim Yung 85f3e2416f RN: Fix `no-react-native-imports` for Windows
Summary:
This lint rule (and the associated Jest test) fails because `path` on Windows outputs backslashes. This diff fixes the rule.

Changelog:
[Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D39887464

fbshipit-source-id: b75480ccf4dcc384e2f7b91d8dcaf3af5f341434
2022-09-28 08:16:49 -07:00
Tim Yung 4f83498462 RN: Replace `error-subclass-name` with `require-extends-error` ESLint Rule
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
2022-09-27 14:37:29 -07:00
Tim Yung 1ec69b1823 RN: Move `no-haste-imports` ESLint Rule into Repository
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
2022-09-27 14:37:29 -07:00
Tim Yung 80b8cefb26 RN: Lint for Internal Package Imports
Summary:
Creates an ESLint rule that prohibits (and autofixes) imports from `react-native` or `react-native/path/to/file`, within the React Native repository.

The ESLint rule is configured using the `eslint-plugin-lint` package instead of `react-native/eslint-plugin` because the rule is only applicable to the React Native repository. The rule does not (and should not) be publicly facing, and changes to the rule should not require publishing new versions of `react-native/eslint-plugin`. (As a follow-up, the `no-haste-imports` rule should be migrated over from `react-native/eslint-plugin`.)

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D39831222

fbshipit-source-id: 566330e6df77fdff5ce755324b9f592b9365019e
2022-09-27 09:22:58 -07:00