Skip to content

Commit

Permalink
PluginObject typings
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed May 11, 2022
1 parent 0f757e0 commit 1d1c56f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/babel-core/src/config/validation/plugins.ts
Expand Up @@ -13,8 +13,8 @@ import type {
} from "./option-assertions";
import type { ParserOptions } from "@babel/parser";
import type { Visitor } from "@babel/traverse";
import type PluginPass from "../../transformation/plugin-pass";
import type { ValidatedOptions } from "./options";
import type { File, PluginPass } from "../../..";

// Note: The casts here are just meant to be static assertions to make sure
// that the assertion functions actually assert that the value's type matches
Expand Down Expand Up @@ -78,14 +78,14 @@ type VisitorHandler =
exit?: Function;
};

export type PluginObject<S = PluginPass> = {
export type PluginObject<S extends PluginPass = PluginPass> = {
name?: string;
manipulateOptions?: (
options: ValidatedOptions,
parserOpts: ParserOptions,
) => void;
pre?: Function;
post?: Function;
pre?: (this: S, file: File) => void;
post?: (this: S, file: File) => void;
inherits?: Function;
visitor?: Visitor<S>;
parserOverride?: Function;
Expand Down

0 comments on commit 1d1c56f

Please sign in to comment.