-
Notifications
You must be signed in to change notification settings - Fork 636
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inline requires: Flow-type plugin and tests
Summary: Ahead of making some changes/enhancements to `inline-requires-plugin`, make it type-safe. Changelog: Internal Reviewed By: vzaidman Differential Revision: D61869704 fbshipit-source-id: 8d61d22fcffd66a28d4860dc596d4b22f685f977
- Loading branch information
1 parent
cef7a3c
commit 00df4ef
Showing
4 changed files
with
222 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* 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 | ||
*/ | ||
|
||
// Partial typings for babel-plugin-tester. Add APIs as you need them. | ||
|
||
declare module 'babel-plugin-tester' { | ||
import typeof * as Babel from '@babel/core'; | ||
import type {BabelCoreOptions, PluginObj} from '@babel/core'; | ||
|
||
declare type PluginTesterOptions<TOpts = mixed, TState = mixed> = { | ||
babelOptions?: BabelCoreOptions, | ||
plugin: (babel: Babel) => PluginObj<TState>, | ||
pluginOptions?: TOpts, | ||
tests: $ReadOnly<{ | ||
[title: string]: $ReadOnly<{ | ||
code: string, | ||
output?: string, | ||
error?: string, | ||
snapshot?: boolean, | ||
... | ||
}>, | ||
}>, | ||
}; | ||
|
||
declare function pluginTester<TOpts = mixed, TState = mixed>( | ||
opts: PluginTesterOptions<TOpts, TState>, | ||
): void; | ||
|
||
declare module.exports: typeof pluginTester; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.