TypeScript: fix trailing comma in enum (#1938)

* fix(typescript): fix trailing comma in enum, fixes #1932

* fix(typescript): use --trailing-comma es5 for enums
This commit is contained in:
Lucas Azzola authored and Christopher Chedeau committed 2017-06-03 05:20:36 -07:00
1 parent c57f2ab507
commit 649cec7fdd
3 files changed
+17 -1

No files matched your search

+2 -1
View File
@@ -2459,7 +2459,8 @@ function genericPrintNoParens(path, options, print, args) {
indent(
concat([
hardline,
printArrayItems(path, options, "members", print)
printArrayItems(path, options, "members", print),
shouldPrintComma(options, "es5") ? "," : ""
])
),
comments.printDanglingComments(
@@ -5,9 +5,19 @@ export class BaseSingleLevelProfileTargeting<
T extends ValidSingleLevelProfileNode,
> {
}
enum Enum {
x = 1,
y = 2,
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export class BaseSingleLevelProfileTargeting<
T extends ValidSingleLevelProfileNode
> {}
enum Enum {
x = 1,
y = 2,
}
`;
@@ -2,3 +2,8 @@ export class BaseSingleLevelProfileTargeting<
T extends ValidSingleLevelProfileNode,
> {
}
enum Enum {
x = 1,
y = 2,
}