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

Commit

Permalink
New: Convert type alias into variable declaration (refs #77) (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry authored and nzakas committed Sep 12, 2016
1 parent 5c47ad5 commit e76f3b9
Show file tree
Hide file tree
Showing 3 changed files with 475 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/ast-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,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

0 comments on commit e76f3b9

Please sign in to comment.