diff --git a/.flowconfig b/.flowconfig index 3a23617f8124..58ca3c06ee61 100644 --- a/.flowconfig +++ b/.flowconfig @@ -39,7 +39,6 @@ [libs] flow-typed/ -packages/react-native/interface.js packages/react-native/flow/ [options] diff --git a/packages/react-native/flow/global.js b/packages/react-native/flow/global.js index dc6de666ec02..3082f3fc48c1 100644 --- a/packages/react-native/flow/global.js +++ b/packages/react-native/flow/global.js @@ -86,3 +86,9 @@ declare var global: { // Undeclared properties are implicitly `any`. [string | symbol]: any, }; + +// Declared as a bare global so unqualified `__DEV__` references type-check as +// `boolean`. The suppression is a no-op in this checkout but avoids a duplicate +// declaration where `__DEV__` is also declared by another Flow libdef. +// $FlowFixMe[libdef-override] +declare var __DEV__: boolean; diff --git a/packages/react-native/interface.js b/packages/react-native/interface.js deleted file mode 100644 index b17169a6b153..000000000000 --- a/packages/react-native/interface.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow strict - * @format - */ - -'use strict'; - -// NOTE: Hmm... I don't think declaring variables within this module actually -// accomplishes anything besides documenting that these globals are expected to -// exist. So I think the correct "fix" to this lint warning is to delete this -// entire file. But in lieu of doing that... no harm for now in keeping this -// file around, even if it is only for documentation purposes. ¯\_(ツ)_/¯ - -/* eslint-disable no-unused-vars */ - -declare var __DEV__: boolean; diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 6ea146756613..ec26182439fe 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -34,14 +34,14 @@ "types": "./types/index.d.ts", "default": "./index.js" }, - "./*": { + "./Libraries/*": { "react-native-strict-api": null, - "types": "./*.d.ts", - "default": "./*.js" + "types": "./Libraries/*.d.ts", + "default": "./Libraries/*.js" }, - "./*.js": { + "./Libraries/*.js": { "react-native-strict-api": null, - "default": "./*.js" + "default": "./Libraries/*.js" }, "./Libraries/*.d.ts": { "react-native-strict-api": null, @@ -49,23 +49,16 @@ }, "./scripts/*": "./scripts/*", "./src/*": { - "react-native-strict-api": null, + "types": null, "default": "./src/*.js" }, "./types/*.d.ts": { "react-native-strict-api": null, "default": "./types/*.d.ts" }, - "./gradle/*": null, - "./React/*": null, - "./ReactAndroid/*": null, - "./ReactApple/*": null, - "./ReactCommon/*": null, - "./sdks/*": null, + "./jest-preset": "./jest-preset.js", + "./rn-get-polyfills": "./rn-get-polyfills.js", "./src/fb_internal/*": "./src/fb_internal/*", - "./third-party-podspecs/*": null, - "./types/*": null, - "./types_generated/*": null, "./package.json": "./package.json" }, "jest-junit": { @@ -80,7 +73,6 @@ "gradle/libs.versions.toml", "index.js", "index.js.flow", - "interface.js", "jest-preset.js", "Libraries", "LICENSE",