From 4dfd8018878a0de4052c53001d62ce6cc4676dad Mon Sep 17 00:00:00 2001 From: Remi Liu Date: Fri, 9 Nov 2018 23:03:53 +0800 Subject: [PATCH] [Types] fix generated TS/Flow comment types (#9007) --- scripts/generators/flow.js | 8 ++++---- scripts/generators/typescript.js | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/generators/flow.js b/scripts/generators/flow.js index b40aa2f2b2..55fc28292c 100644 --- a/scripts/generators/flow.js +++ b/scripts/generators/flow.js @@ -15,12 +15,12 @@ declare class ${NODE_PREFIX}Comment { loc: ${NODE_PREFIX}SourceLocation; } -declare class ${NODE_PREFIX}BlockComment extends ${NODE_PREFIX}Comment { - type: "BlockComment"; +declare class ${NODE_PREFIX}CommentBlock extends ${NODE_PREFIX}Comment { + type: "CommentBlock"; } -declare class ${NODE_PREFIX}LineComment extends ${NODE_PREFIX}Comment { - type: "LineComment"; +declare class ${NODE_PREFIX}CommentLine extends ${NODE_PREFIX}Comment { + type: "CommentLine"; } declare class ${NODE_PREFIX}SourceLocation { diff --git a/scripts/generators/typescript.js b/scripts/generators/typescript.js index d31c0a533d..ae93bee0b2 100644 --- a/scripts/generators/typescript.js +++ b/scripts/generators/typescript.js @@ -11,18 +11,18 @@ interface BaseComment { start: number; end: number; loc: SourceLocation; - type: "BlockComment" | "LineComment"; + type: "CommentBlock" | "CommentLine"; } -export interface BlockComment extends BaseComment { - type: "BlockComment"; +export interface CommentBlock extends BaseComment { + type: "CommentBlock"; } -export interface LineComment extends BaseComment { - type: "LineComment"; +export interface CommentLine extends BaseComment { + type: "CommentLine"; } -export type Comment = BlockComment | LineComment; +export type Comment = CommentBlock | CommentLine; export interface SourceLocation { start: {