Configure `@react-native-community/eslint-config` as a yarn workspace (#34423)
Summary: Changes the React Native base ESLint configuration to consume `react-native-community/eslint-config` as a [yarn workspace](https://classic.yarnpkg.com/lang/en/docs/workspaces/), so that any dependencies of `react-native-community/eslint-config` can also be resolved from the root directory of `react-native`. Previously, `~/.eslintrc.js` extended `react-native-community/eslint-config` using a relative file path. This is problematic because if any dependencies (notably, optional peer dependencies such as some of the TypeScript dependencies) are not already installed at the root directory of `react-native`, running ESLint could fail to resolve any required dependencies. In other words, there was an implicit dependency that `react-native/yarn.lock` would also contain any dependencies required by `react-native/packages/eslint-config-react-native-community/yarn.lock`. With this change, running `yarn` from the root directory of `react-native` will also install any dependencies of `react-native-community/eslint-config`, and it will also symlink `react-native/node_modules/react-native-community/eslint-config` to `../../packages/eslint-config-react-native-community` (meaning any local changes to the config will still be reflected during active development). ## Changelog [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/34423 Test Plan: Successfully install dependencies and run ESLint. ``` $ cd react-native $ yarn $ yarn lint ``` Successfully run Danger on https://github.com/facebook/react-native/pull/34401 (which would previously fail because `typescript-eslint/eslint-plugin` could not be resolved from the root directory of `react-native`): ``` $ cd react-native/bots $ yarn $ node ./node_modules/.bin/danger pr https://github.com/facebook/react-native/pull/34401 ``` Reviewed By: NickGerleman Differential Revision: D38710285 Pulled By: yungsters fbshipit-source-id: a06ceea0884a90be60f6f5db9a5d42be52a951d5
This commit is contained in:
Родитель
dfcd9faaad
Коммит
be8fe7a9c1
|
@ -12,7 +12,7 @@
|
|||
module.exports = {
|
||||
root: true,
|
||||
|
||||
extends: ['./packages/eslint-config-react-native-community/index.js'],
|
||||
extends: ['@react-native-community'],
|
||||
|
||||
plugins: ['@react-native/eslint-plugin-specs'],
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
"test-ios": "./scripts/objc-test.sh test"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/!(eslint-config-react-native-community)",
|
||||
"packages/*",
|
||||
"repo-config"
|
||||
],
|
||||
"peerDependencies": {
|
||||
|
|
80
yarn.lock
80
yarn.lock
|
@ -1404,6 +1404,31 @@
|
|||
dependencies:
|
||||
"@types/yargs-parser" "*"
|
||||
|
||||
"@typescript-eslint/eslint-plugin@^5.30.5":
|
||||
version "5.33.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.33.0.tgz#059798888720ec52ffa96c5f868e31a8f70fa3ec"
|
||||
integrity sha512-jHvZNSW2WZ31OPJ3enhLrEKvAZNyAFWZ6rx9tUwaessTc4sx9KmgMNhVcqVAl1ETnT5rU5fpXTLmY9YvC1DCNg==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "5.33.0"
|
||||
"@typescript-eslint/type-utils" "5.33.0"
|
||||
"@typescript-eslint/utils" "5.33.0"
|
||||
debug "^4.3.4"
|
||||
functional-red-black-tree "^1.0.1"
|
||||
ignore "^5.2.0"
|
||||
regexpp "^3.2.0"
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/parser@^5.30.5":
|
||||
version "5.33.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.33.0.tgz#26ec3235b74f0667414613727cb98f9b69dc5383"
|
||||
integrity sha512-cgM5cJrWmrDV2KpvlcSkelTBASAs1mgqq+IUGKJvFxWrapHpaRy5EXPQz9YaKF3nZ8KY18ILTiVpUtbIac86/w==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "5.33.0"
|
||||
"@typescript-eslint/types" "5.33.0"
|
||||
"@typescript-eslint/typescript-estree" "5.33.0"
|
||||
debug "^4.3.4"
|
||||
|
||||
"@typescript-eslint/scope-manager@5.30.5":
|
||||
version "5.30.5"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.30.5.tgz#7f90b9d6800552c856a5f3644f5e55dd1469d964"
|
||||
|
@ -1412,11 +1437,33 @@
|
|||
"@typescript-eslint/types" "5.30.5"
|
||||
"@typescript-eslint/visitor-keys" "5.30.5"
|
||||
|
||||
"@typescript-eslint/scope-manager@5.33.0":
|
||||
version "5.33.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.33.0.tgz#509d7fa540a2c58f66bdcfcf278a3fa79002e18d"
|
||||
integrity sha512-/Jta8yMNpXYpRDl8EwF/M8It2A9sFJTubDo0ATZefGXmOqlaBffEw0ZbkbQ7TNDK6q55NPHFshGBPAZvZkE8Pw==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.33.0"
|
||||
"@typescript-eslint/visitor-keys" "5.33.0"
|
||||
|
||||
"@typescript-eslint/type-utils@5.33.0":
|
||||
version "5.33.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.33.0.tgz#92ad1fba973c078d23767ce2d8d5a601baaa9338"
|
||||
integrity sha512-2zB8uEn7hEH2pBeyk3NpzX1p3lF9dKrEbnXq1F7YkpZ6hlyqb2yZujqgRGqXgRBTHWIUG3NGx/WeZk224UKlIA==
|
||||
dependencies:
|
||||
"@typescript-eslint/utils" "5.33.0"
|
||||
debug "^4.3.4"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/types@5.30.5":
|
||||
version "5.30.5"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.30.5.tgz#36a0c05a72af3623cdf9ee8b81ea743b7de75a98"
|
||||
integrity sha512-kZ80w/M2AvsbRvOr3PjaNh6qEW1LFqs2pLdo2s5R38B2HYXG8Z0PP48/4+j1QHJFL3ssHIbJ4odPRS8PlHrFfw==
|
||||
|
||||
"@typescript-eslint/types@5.33.0":
|
||||
version "5.33.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.0.tgz#d41c584831805554b063791338b0220b613a275b"
|
||||
integrity sha512-nIMt96JngB4MYFYXpZ/3ZNU4GWPNdBbcB5w2rDOCpXOVUkhtNlG2mmm8uXhubhidRZdwMaMBap7Uk8SZMU/ppw==
|
||||
|
||||
"@typescript-eslint/typescript-estree@5.30.5":
|
||||
version "5.30.5"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.5.tgz#c520e4eba20551c4ec76af8d344a42eb6c9767bb"
|
||||
|
@ -1430,6 +1477,31 @@
|
|||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/typescript-estree@5.33.0":
|
||||
version "5.33.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.0.tgz#02d9c9ade6f4897c09e3508c27de53ad6bfa54cf"
|
||||
integrity sha512-tqq3MRLlggkJKJUrzM6wltk8NckKyyorCSGMq4eVkyL5sDYzJJcMgZATqmF8fLdsWrW7OjjIZ1m9v81vKcaqwQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.33.0"
|
||||
"@typescript-eslint/visitor-keys" "5.33.0"
|
||||
debug "^4.3.4"
|
||||
globby "^11.1.0"
|
||||
is-glob "^4.0.3"
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/utils@5.33.0":
|
||||
version "5.33.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.33.0.tgz#46797461ce3146e21c095d79518cc0f8ec574038"
|
||||
integrity sha512-JxOAnXt9oZjXLIiXb5ZIcZXiwVHCkqZgof0O8KPgz7C7y0HS42gi75PdPlqh1Tf109M0fyUw45Ao6JLo7S5AHw==
|
||||
dependencies:
|
||||
"@types/json-schema" "^7.0.9"
|
||||
"@typescript-eslint/scope-manager" "5.33.0"
|
||||
"@typescript-eslint/types" "5.33.0"
|
||||
"@typescript-eslint/typescript-estree" "5.33.0"
|
||||
eslint-scope "^5.1.1"
|
||||
eslint-utils "^3.0.0"
|
||||
|
||||
"@typescript-eslint/utils@^5.10.0":
|
||||
version "5.30.5"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.30.5.tgz#3999cbd06baad31b9e60d084f20714d1b2776765"
|
||||
|
@ -1450,6 +1522,14 @@
|
|||
"@typescript-eslint/types" "5.30.5"
|
||||
eslint-visitor-keys "^3.3.0"
|
||||
|
||||
"@typescript-eslint/visitor-keys@5.33.0":
|
||||
version "5.33.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.0.tgz#fbcbb074e460c11046e067bc3384b5d66b555484"
|
||||
integrity sha512-/XsqCzD4t+Y9p5wd9HZiptuGKBlaZO5showwqODii5C0nZawxWLF+Q6k5wYHBrQv96h6GYKyqqMHCSTqta8Kiw==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.33.0"
|
||||
eslint-visitor-keys "^3.3.0"
|
||||
|
||||
abab@^2.0.3, abab@^2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a"
|
||||
|
|
Загрузка…
Ссылка в новой задаче