Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Types] fix generated TS/Flow comment types #9007

Merged
merged 1 commit into from Nov 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/generators/flow.js
Expand Up @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions scripts/generators/typescript.js
Expand Up @@ -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: {
Expand Down