From 1d1c56f24326cc8f1032465f5b8c9ba678a2481f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 6 May 2022 14:20:14 -0400 Subject: [PATCH] PluginObject typings --- packages/babel-core/src/config/validation/plugins.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/babel-core/src/config/validation/plugins.ts b/packages/babel-core/src/config/validation/plugins.ts index ff7565cafcc8..9364758f153b 100644 --- a/packages/babel-core/src/config/validation/plugins.ts +++ b/packages/babel-core/src/config/validation/plugins.ts @@ -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 @@ -78,14 +78,14 @@ type VisitorHandler = exit?: Function; }; -export type PluginObject = { +export type PluginObject = { 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; parserOverride?: Function;