From 5cfb88685f2b5f168edf356fb2cd9de799d36ac2 Mon Sep 17 00:00:00 2001 From: Lorenzo Sciandra Date: Fri, 4 Nov 2022 03:31:21 -0700 Subject: [PATCH] fix (deps): add explicitly eslint config to dependencies (#35192) Summary: Basically since this change https://github.com/facebook/react-native/pull/34423 everything worked ok because in the main branch where the monorepo has the workspace section and everything, `react-native-community/eslint-config` was getting pulled in as a node_module anyway - but when moving to a stable branch and wanting to do a release, as we are now with 0.71, because of what the final package.json looks like for react-native and [the modifications that it goes through](https://github.com/facebook/react-native/commit/f0054e1e303e238d40970d23a3b3ae47502c32ea#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519) (ex. the `workspace` section disappears), the fact that it's not directly listed as dependency makes [the CI fails](https://app.circleci.com/pipelines/github/facebook/react-native/17124/workflows/54a4162d-f466-4eab-94ba-ec9fe77e2ecf/jobs/339643) with `Error: Failed to load config "react-native-community" to extend from.` ## Changelog [General] [Fixed] - add explicitly eslint config to dependencies Pull Request resolved: https://github.com/facebook/react-native/pull/35192 Test Plan: In 0.71, add the deps to see the error disappear (it gets replaced by a different one though, looking into that) Reviewed By: jacdebug, cortinico Differential Revision: D40988407 Pulled By: cipolleschi fbshipit-source-id: 38f433a0b4b47a7cb61b59e887459d11182a5b4b --- .../eslint-config-react-native-community/BUCK | 23 +++++++++++++++++++ repo-config/package.json | 1 + 2 files changed, 24 insertions(+) create mode 100644 packages/eslint-config-react-native-community/BUCK diff --git a/packages/eslint-config-react-native-community/BUCK b/packages/eslint-config-react-native-community/BUCK new file mode 100644 index 00000000000..8fd38289431 --- /dev/null +++ b/packages/eslint-config-react-native-community/BUCK @@ -0,0 +1,23 @@ +load("@fbsource//tools/build_defs/third_party:yarn_defs.bzl", "yarn_workspace") + +yarn_workspace( + name = "yarn-workspace", + srcs = glob( + ["**/*.js"], + exclude = [ + "**/__fixtures__/**", + "**/__flowtests__/**", + "**/__mocks__/**", + "**/__server_snapshot_tests__/**", + "**/__tests__/**", + "**/node_modules/**", + "**/node_modules/.bin/**", + "**/.*", + "**/.*/**", + "**/.*/.*", + "**/*.xcodeproj/**", + "**/*.xcworkspace/**", + ], + ), + visibility = ["PUBLIC"], +) diff --git a/repo-config/package.json b/repo-config/package.json index 00eef94f108..d0a2a719c3b 100644 --- a/repo-config/package.json +++ b/repo-config/package.json @@ -14,6 +14,7 @@ "@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-plugin-specs": "^0.71.1", "@reactions/component": "^2.0.2",