diff --git a/.flowconfig b/.flowconfig index f8075b2b4bd1..0cd86610c277 100644 --- a/.flowconfig +++ b/.flowconfig @@ -16,6 +16,7 @@ packages/react-native-codegen/e2e/__test_fixtures__/modules/NativeEnumTurboModul **/*.windows.js **/node_modules/resolve/test/resolver/malformed_package_json/package.json +**/node_modules/invariant/** ; Checked-in build output packages/debugger-frontend/dist/** @@ -52,6 +53,9 @@ experimental.multi_platform=true experimental.multi_platform.extensions=.ios experimental.multi_platform.extensions=.android +experimental.assertion_functions=true +experimental.disable_invariant_special_casing=true + munge_underscores=true module.name_mapper='^react-native$' -> '/packages/react-native/index.js' diff --git a/flow-typed/npm/invariant_v2.x.x.js b/flow-typed/npm/invariant_v2.x.x.js new file mode 100644 index 000000000000..74cb0815afc9 --- /dev/null +++ b/flow-typed/npm/invariant_v2.x.x.js @@ -0,0 +1,23 @@ +/** + * 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-local + * @format + */ + +declare module 'invariant' { + declare module.exports: ( + condition: unknown, + format?: string, + ...args: Array + ) => asserts condition; +} + +declare module 'invariant/invariant' { + import typeof Invariant from 'invariant'; + + declare module.exports: Invariant; +}