From d9c84f078d9cd6cd79bc29153b5dea3da8a69e52 Mon Sep 17 00:00:00 2001 From: Panagiotis Vekris Date: Tue, 19 Jan 2021 11:52:08 -0800 Subject: [PATCH] misc Flow library fixes & suppressions Summary: The current version of Flow fails to report some errors in library definitions. I'm working on a Flow fix that would surface these errors. In preparation for this, this diff: * replaces `FbtErrorListener` (missing) with `IFbtErrorListener` in fbt.js * fixes typos in several files * suppresses missing names with `[cannot-resolve-name]` * adds `sourceMapTarget` option in babel-generator Changelog: [Internal] Reviewed By: jbrown215 Differential Revision: D25839533 fbshipit-source-id: 947207db9238aa10663616d59080440d2ac6f243 --- flow-typed/npm/promise_v8.x.x.js | 6 +++--- jest/preprocessor.js | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flow-typed/npm/promise_v8.x.x.js b/flow-typed/npm/promise_v8.x.x.js index bdb0f5a0e02..f7eb92e4d12 100644 --- a/flow-typed/npm/promise_v8.x.x.js +++ b/flow-typed/npm/promise_v8.x.x.js @@ -4,15 +4,15 @@ */ declare module 'promise/setimmediate/es6-extensions' { - declare module.exports: Class; + declare module.exports: typeof Promise; } declare module 'promise/setimmediate/done' { - declare module.exports: Class; + declare module.exports: typeof Promise; } declare module 'promise/setimmediate/finally' { - declare module.exports: Class; + declare module.exports: typeof Promise; } declare module 'promise/setimmediate/rejection-tracking' { diff --git a/jest/preprocessor.js b/jest/preprocessor.js index 7e8ed8de0ea..e9d12710ddf 100644 --- a/jest/preprocessor.js +++ b/jest/preprocessor.js @@ -101,6 +101,7 @@ module.exports = { return generate( ast, + // $FlowFixMe[prop-missing] Error found when improving flow typing for libs { code: true, comments: false,