Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

New: Convert type alias into variable declaration (refs #77) #83

Merged
merged 1 commit into from
Sep 12, 2016
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/ast-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1778,6 +1778,19 @@ module.exports = function(ast, extra) {
case SyntaxKind.ParenthesizedExpression:
return convert(node.expression, parent);

/**
* Convert TypeAliasDeclaration node into VariableDeclaration
* to allow core rules such as "semi" to work automatically
*/
case SyntaxKind.TypeAliasDeclaration:
deeplyCopy();
assign(result, {
type: "VariableDeclaration",
kind: "type",
declarations: []
});
break;

default:
deeplyCopy();
}
Expand Down
Loading