[babel] Add hermes-parser type definitions to babel-plugin
Lauren Tan committed
Nov 3, 2023 at 15:22 UTC
fe147cb16a3ec82220d2599bb59ee12fc7319687
2 files changed
+14
-21
compiler/packages/babel-plugin-react-forget/src/Babel/types.d.ts
+14
-1
@@ -6,4 +6,17 @@
6
*/
7
8
declare module "@babel/plugin-syntax-jsx";
9
-declare module "hermes-parser";
9
+
10
+// v0.17.1
11
+declare module "hermes-parser" {
12
+ type HermesParserOptions = {
13
+ allowReturnOutsideFunction?: boolean;
14
+ babel?: boolean;
15
+ flow?: "all" | "detect";
16
+ enableExperimentalComponentSyntax?: boolean;
17
+ sourceFilename?: string;
18
+ sourceType?: "module" | "script" | "unambiguous";
19
+ tokens?: boolean;
20
+ };
21
+ export function parse(code: string, options: Partial<HermesParserOptions>);
22
+}
compiler/packages/eslint-plugin-react-forget/src/types/hermes-parser.d.ts
deleted
-20
@@ -1,20 +0,0 @@
1
-/**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
-// v0.17.1
9
-declare module "hermes-parser" {
10
- type HermesParserOptions = {
11
- allowReturnOutsideFunction?: boolean;
12
- babel?: boolean;
13
- flow?: "all" | "detect";
14
- enableExperimentalComponentSyntax?: boolean;
15
- sourceFilename?: string;
16
- sourceType?: "module" | "script" | "unambiguous";
17
- tokens?: boolean;
18
- };
19
- export function parse(code: string, options: Partial<HermesParserOptions>);
20
-}