Skip to content

Commit 7ba64ca

Browse files
SamChou19815facebook-github-bot
authored andcommitted
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<T>.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
1 parent 0e77015 commit 7ba64ca

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

scripts/js-api/build-types/transforms/typescript/simplifyTypes/resolveBuiltinType.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ const builtinTypeResolvers: {
147147
const propName =
148148
propNode.type === 'Identifier' ? propNode.name : propNode.value;
149149

150+
/* $FlowFixMe[incompatible-type] Error exposed after improved typing
151+
* of Array.{includes,indexOf,lastIndexOf} */
150152
return !stringLiteralElements.includes(propName);
151153
}),
152154
),

0 commit comments

Comments
 (0)