Skip to content

Commit

Permalink
eslint config & plugin packages - prep for monorepo RFC (#34581)
Browse files Browse the repository at this point in the history
Summary:
The [monorepo RFC](react-native-community/discussions-and-proposals#480) calls for renaming:

* `react-native-community/eslint-config` -> `react-native/eslint-config`
* `react-native-community/eslint-plugin` -> `react-native/eslint-plugin`

It also calls for the versions to be aligned with the rest of main -- currently `0.72.0`.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General][Changed] - Renamed `react-native-community/eslint-config` to `react-native/eslint-config` v0.72.0 to align with other packages
[General][Changed] - Renamed `react-native-community/eslint-plugin` to `react-native/eslint-plugin` v0.72.0 to align with other packages

Pull Request resolved: #34581

Test Plan:
First test is to run `yarn lint`, and verify that output matches before and after this change.

Second test is to change the ESLint config to use the "old" packages (under `react-native-commnuity`) and run `yarn lint` to make sure that they work as expected. This is what customers will experience, until they manually move to the new ESLint packages.

Reviewed By: cortinico

Differential Revision: D41520500

Pulled By: hoxyq

fbshipit-source-id: a61e5ae15d5aaf11f0143a3b0257a60a03b1550b
  • Loading branch information
afoxman authored and facebook-github-bot committed Nov 25, 2022
1 parent 319631f commit 5aead70
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 30 deletions.
7 changes: 0 additions & 7 deletions .circleci/verdaccio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ packages:
'@react-native/*':
access: $all
publish: $all
# The below specific entries can be removed once they are renamed and have the @react-native prefix
'@react-native-community/eslint-config':
access: $all
publish: $all
'@react-native-community/eslint-plugin':
access: $all
publish: $all
'react-native-codegen':
access: $all
publish: $all
Expand Down
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require('eslint-plugin-lint').load(path.join(__dirname, 'tools/eslint/rules'));
module.exports = {
root: true,

extends: ['@react-native-community'],
extends: ['@react-native'],

plugins: ['@react-native/eslint-plugin-specs', 'lint'],

Expand All @@ -38,7 +38,7 @@ module.exports = {
{
files: ['Libraries/**/*.js'],
rules: {
'@react-native-community/platform-colors': 2,
'@react-native/platform-colors': 2,
'@react-native/specs/react-native-modules': 2,
'lint/no-haste-imports': 2,
'lint/no-react-native-imports': 2,
Expand Down
11 changes: 5 additions & 6 deletions packages/eslint-config-react-native-community/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# eslint-config-react-native-community
# @react-native/eslint-config

[![Version][version-badge]][package]

## Installation

```
yarn add --dev eslint prettier @react-native-community/eslint-config
yarn add --dev eslint prettier @react-native/eslint-config
```

*Note: We're using `yarn` to install deps. Feel free to change commands to use `npm` 3+ and `npx` if you like*
Expand All @@ -16,10 +16,9 @@ Add to your eslint config (`.eslintrc`, or `eslintConfig` field in `package.json

```json
{
"extends": "@react-native-community"
"extends": "@react-native"
}
```

[version-badge]: https://img.shields.io/npm/v/@react-native-community/eslint-config.svg?style=flat-square
[package]: https://www.npmjs.com/package/@react-native-community/eslint-config

[version-badge]: https://img.shields.io/npm/v/@react-native/eslint-config.svg?style=flat-square
[package]: https://www.npmjs.com/package/@react-native/eslint-config
2 changes: 1 addition & 1 deletion packages/eslint-config-react-native-community/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
'react',
'react-hooks',
'react-native',
'@react-native-community',
'@react-native',
'jest',
],

Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-config-react-native-community/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-community/eslint-config",
"version": "3.2.0",
"name": "@react-native/eslint-config",
"version": "0.72.0",
"description": "ESLint config for React Native",
"main": "index.js",
"license": "MIT",
Expand All @@ -13,7 +13,7 @@
"dependencies": {
"@babel/core": "^7.14.0",
"@babel/eslint-parser": "^7.18.2",
"@react-native-community/eslint-plugin": "^1.1.0",
"@react-native/eslint-plugin": "^0.72.0",
"@typescript-eslint/eslint-plugin": "^5.30.5",
"@typescript-eslint/parser": "^5.30.5",
"eslint-config-prettier": "^8.5.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-plugin-react-native-community/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# eslint-plugin-react-native-community
# @react-native/eslint-plugin

This plugin is intended to be used in [`@react-native-community/eslint-config`](https://github.com/facebook/react-native/tree/HEAD/packages/eslint-config-react-native-community). You probably want to install that package instead.
This plugin is intended to be used in [`@react-native/eslint-config`](https://github.com/facebook/react-native/tree/HEAD/packages/eslint-config-react-native-community). You probably want to install that package instead.

## Installation

```
yarn add --dev eslint @react-native-community/eslint-plugin
yarn add --dev eslint @react-native/eslint-plugin
```

*Note: We're using `yarn` to install deps. Feel free to change commands to use `npm` 3+ and `npx` if you like*
Expand All @@ -16,7 +16,7 @@ Add to your eslint config (`.eslintrc`, or `eslintConfig` field in `package.json

```json
{
"plugins": ["@react-native-community"]
"plugins": ["@react-native"]
}
```

Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-plugin-react-native-community/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@react-native-community/eslint-plugin",
"version": "1.3.0",
"description": "ESLint rules for @react-native-community/eslint-config",
"name": "@react-native/eslint-plugin",
"version": "0.72.0",
"description": "ESLint rules for @react-native/eslint-config",
"main": "index.js",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions repo-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"@babel/generator": "^7.14.0",
"@babel/plugin-transform-regenerator": "^7.0.0",
"@definitelytyped/dtslint": "^0.0.127",
"@react-native-community/eslint-config": "*",
"@react-native-community/eslint-plugin": "*",
"@react-native/eslint-config": "*",
"@react-native/eslint-plugin": "*",
"@react-native/eslint-plugin-specs": "^0.72.0",
"@reactions/component": "^2.0.2",
"@types/react": "^18.0.18",
Expand Down
2 changes: 1 addition & 1 deletion template/_eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
root: true,
extends: '@react-native-community',
extends: '@react-native',
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
};
2 changes: 1 addition & 1 deletion template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@babel/core": "^7.12.9",
"@babel/preset-env": "^7.14.0",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^3.0.0",
"@react-native/eslint-config": "^0.72.0",
"@tsconfig/react-native": "^2.0.2",
"@types/jest": "^29.2.1",
"@types/react": "^18.0.24",
Expand Down

0 comments on commit 5aead70

Please sign in to comment.