Skip to content

Commit

Permalink
@babel/core: add loadPartialConfigAsync (#51741)
Browse files Browse the repository at this point in the history
* @babel/core: add `loadPartialConfigAsync`

* test
  • Loading branch information
SimenB authored Mar 15, 2021
1 parent 71dda12 commit a072046
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions types/babel__core/babel__core-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ checkConfigFunction(api => {
// $ExpectType Readonly<PartialConfig> | null
const partialConfig = babel.loadPartialConfig();

// $ExpectType Promise<Readonly<PartialConfig> | null>
const partialConfigPromise = babel.loadPartialConfigAsync();

if (partialConfig) {
// $ExpectType boolean
partialConfig.hasFilesystemConfig();
Expand Down
1 change: 1 addition & 0 deletions types/babel__core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ export function loadOptions(options?: TransformOptions): object | null;
* information about `ConfigItem` fields.
*/
export function loadPartialConfig(options?: TransformOptions): Readonly<PartialConfig> | null;
export function loadPartialConfigAsync(options?: TransformOptions): Promise<Readonly<PartialConfig> | null>;

export interface PartialConfig {
options: TransformOptions;
Expand Down

0 comments on commit a072046

Please sign in to comment.