Skip to content

Commit d6395ab

Browse files
afoxmanOlimpiaZurek
authored andcommitted
eslint config & plugin packages - prep for monorepo RFC (facebook#34581)
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: facebook#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
1 parent ee6ff8b commit d6395ab

File tree

10 files changed

+22
-30
lines changed

10 files changed

+22
-30
lines changed

.circleci/verdaccio.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ packages:
1919
'@react-native/*':
2020
access: $all
2121
publish: $all
22-
# The below specific entries can be removed once they are renamed and have the @react-native prefix
23-
'@react-native-community/eslint-config':
24-
access: $all
25-
publish: $all
26-
'@react-native-community/eslint-plugin':
27-
access: $all
28-
publish: $all
2922
'react-native-codegen':
3023
access: $all
3124
publish: $all

.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require('eslint-plugin-lint').load(path.join(__dirname, 'tools/eslint/rules'));
1616
module.exports = {
1717
root: true,
1818

19-
extends: ['@react-native-community'],
19+
extends: ['@react-native'],
2020

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

@@ -38,7 +38,7 @@ module.exports = {
3838
{
3939
files: ['Libraries/**/*.js'],
4040
rules: {
41-
'@react-native-community/platform-colors': 2,
41+
'@react-native/platform-colors': 2,
4242
'@react-native/specs/react-native-modules': 2,
4343
'lint/no-haste-imports': 2,
4444
'lint/no-react-native-imports': 2,
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# eslint-config-react-native-community
1+
# @react-native/eslint-config
22

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

55
## Installation
66

77
```
8-
yarn add --dev eslint prettier @react-native-community/eslint-config
8+
yarn add --dev eslint prettier @react-native/eslint-config
99
```
1010

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

1717
```json
1818
{
19-
"extends": "@react-native-community"
19+
"extends": "@react-native"
2020
}
2121
```
2222

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

packages/eslint-config-react-native-community/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = {
2323
'react',
2424
'react-hooks',
2525
'react-native',
26-
'@react-native-community',
26+
'@react-native',
2727
'jest',
2828
],
2929

packages/eslint-config-react-native-community/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@react-native-community/eslint-config",
3-
"version": "3.2.0",
2+
"name": "@react-native/eslint-config",
3+
"version": "0.72.0",
44
"description": "ESLint config for React Native",
55
"main": "index.js",
66
"license": "MIT",
@@ -13,7 +13,7 @@
1313
"dependencies": {
1414
"@babel/core": "^7.14.0",
1515
"@babel/eslint-parser": "^7.18.2",
16-
"@react-native-community/eslint-plugin": "^1.1.0",
16+
"@react-native/eslint-plugin": "^0.72.0",
1717
"@typescript-eslint/eslint-plugin": "^5.30.5",
1818
"@typescript-eslint/parser": "^5.30.5",
1919
"eslint-config-prettier": "^8.5.0",

packages/eslint-plugin-react-native-community/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# eslint-plugin-react-native-community
1+
# @react-native/eslint-plugin
22

3-
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.
3+
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.
44

55
## Installation
66

77
```
8-
yarn add --dev eslint @react-native-community/eslint-plugin
8+
yarn add --dev eslint @react-native/eslint-plugin
99
```
1010

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

1717
```json
1818
{
19-
"plugins": ["@react-native-community"]
19+
"plugins": ["@react-native"]
2020
}
2121
```
2222

packages/eslint-plugin-react-native-community/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "@react-native-community/eslint-plugin",
3-
"version": "1.3.0",
4-
"description": "ESLint rules for @react-native-community/eslint-config",
2+
"name": "@react-native/eslint-plugin",
3+
"version": "0.72.0",
4+
"description": "ESLint rules for @react-native/eslint-config",
55
"main": "index.js",
66
"repository": {
77
"type": "git",

repo-config/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"@babel/generator": "^7.14.0",
1515
"@babel/plugin-transform-regenerator": "^7.0.0",
1616
"@definitelytyped/dtslint": "^0.0.127",
17-
"@react-native-community/eslint-config": "*",
18-
"@react-native-community/eslint-plugin": "*",
17+
"@react-native/eslint-config": "*",
18+
"@react-native/eslint-plugin": "*",
1919
"@react-native/eslint-plugin-specs": "^0.72.0",
2020
"@reactions/component": "^2.0.2",
2121
"@types/react": "^18.0.18",

template/_eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native-community',
3+
extends: '@react-native',
44
parser: '@typescript-eslint/parser',
55
plugins: ['@typescript-eslint'],
66
};

template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@babel/core": "^7.12.9",
1818
"@babel/preset-env": "^7.14.0",
1919
"@babel/runtime": "^7.12.5",
20-
"@react-native-community/eslint-config": "^3.0.0",
20+
"@react-native/eslint-config": "^0.72.0",
2121
"@tsconfig/react-native": "^2.0.2",
2222
"@types/jest": "^29.2.1",
2323
"@types/react": "^18.0.24",

0 commit comments

Comments
 (0)