From 7ba64ca0f12238037fcae0426b0641fcb8752f69 Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Fri, 19 Sep 2025 07:17:14 -0700 Subject: [PATCH] Pre-suppress errors for improved typing of `Array.{includes,indexOf,lastIndexOf}` in xplat Summary: In Flow 0.284, we will have a stricter version of `Array.includes`. Instead of accepting `mixed`, we will only accept `T` to help catch logical errors. We did the same for `Array.indexOf` and `Array.lastIndexOf` as well. This diff pre-suppresses newly discovered errors in part of the codebase. Changelog: [Internal] Reviewed By: marcoww6 Differential Revision: D82784398 fbshipit-source-id: 6cb11809844f964e0604d33b9f7a3989074cd1cc --- .../transforms/typescript/simplifyTypes/resolveBuiltinType.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/js-api/build-types/transforms/typescript/simplifyTypes/resolveBuiltinType.js b/scripts/js-api/build-types/transforms/typescript/simplifyTypes/resolveBuiltinType.js index a05fb1ae53d..35b72001a1d 100644 --- a/scripts/js-api/build-types/transforms/typescript/simplifyTypes/resolveBuiltinType.js +++ b/scripts/js-api/build-types/transforms/typescript/simplifyTypes/resolveBuiltinType.js @@ -147,6 +147,8 @@ const builtinTypeResolvers: { const propName = propNode.type === 'Identifier' ? propNode.name : propNode.value; + /* $FlowFixMe[incompatible-type] Error exposed after improved typing + * of Array.{includes,indexOf,lastIndexOf} */ return !stringLiteralElements.includes(propName); }), ),