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

Commit 209710a

Browse files
committed
New: Convert type alias into variable declaration (refs #77)
1 parent 799fd63 commit 209710a

File tree

3 files changed

+475
-0
lines changed

3 files changed

+475
-0
lines changed

lib/ast-converter.js

+13
Original file line numberDiff line numberDiff line change
@@ -1778,6 +1778,19 @@ module.exports = function(ast, extra) {
17781778
case SyntaxKind.ParenthesizedExpression:
17791779
return convert(node.expression, parent);
17801780

1781+
/**
1782+
* Convert TypeAliasDeclaration node into VariableDeclaration
1783+
* to allow core rules such as "semi" to work automatically
1784+
*/
1785+
case SyntaxKind.TypeAliasDeclaration:
1786+
deeplyCopy();
1787+
assign(result, {
1788+
type: "VariableDeclaration",
1789+
kind: "type",
1790+
declarations: []
1791+
});
1792+
break;
1793+
17811794
default:
17821795
deeplyCopy();
17831796
}

0 commit comments

Comments
 (0)