From fe147cb16a3ec82220d2599bb59ee12fc7319687 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 3 Nov 2023 15:22:53 -0400 Subject: [PATCH] [babel] Add hermes-parser type definitions to babel-plugin --- .../src/Babel/types.d.ts | 15 +++++++++++++- .../src/types/hermes-parser.d.ts | 20 ------------------- 2 files changed, 14 insertions(+), 21 deletions(-) delete mode 100644 compiler/packages/eslint-plugin-react-forget/src/types/hermes-parser.d.ts diff --git a/compiler/packages/babel-plugin-react-forget/src/Babel/types.d.ts b/compiler/packages/babel-plugin-react-forget/src/Babel/types.d.ts index bd8ea2dc65..38d3fee074 100644 --- a/compiler/packages/babel-plugin-react-forget/src/Babel/types.d.ts +++ b/compiler/packages/babel-plugin-react-forget/src/Babel/types.d.ts @@ -6,4 +6,17 @@ */ declare module "@babel/plugin-syntax-jsx"; -declare module "hermes-parser"; + +// v0.17.1 +declare module "hermes-parser" { + type HermesParserOptions = { + allowReturnOutsideFunction?: boolean; + babel?: boolean; + flow?: "all" | "detect"; + enableExperimentalComponentSyntax?: boolean; + sourceFilename?: string; + sourceType?: "module" | "script" | "unambiguous"; + tokens?: boolean; + }; + export function parse(code: string, options: Partial); +} diff --git a/compiler/packages/eslint-plugin-react-forget/src/types/hermes-parser.d.ts b/compiler/packages/eslint-plugin-react-forget/src/types/hermes-parser.d.ts deleted file mode 100644 index 40771d183c..0000000000 --- a/compiler/packages/eslint-plugin-react-forget/src/types/hermes-parser.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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. - */ - -// v0.17.1 -declare module "hermes-parser" { - type HermesParserOptions = { - allowReturnOutsideFunction?: boolean; - babel?: boolean; - flow?: "all" | "detect"; - enableExperimentalComponentSyntax?: boolean; - sourceFilename?: string; - sourceType?: "module" | "script" | "unambiguous"; - tokens?: boolean; - }; - export function parse(code: string, options: Partial); -}