Skip to content

Commit e7fb6a6

Browse files
committed
fix(code-gen): add trailing comma in multi-line imports
1 parent 0852288 commit e7fb6a6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/code-gen/src/target/javascript.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ export class JavascriptImportCollector {
9494

9595
if (isMultiline) {
9696
result.push(
97-
`import${this.isTypeImports ? " type" : ""} {\n ${symbols.join(",\n ")}\n} from "${key}";`,
97+
`import${this.isTypeImports ? " type" : ""} {\n ${symbols.join(",\n ")},\n} from "${key}";`,
9898
);
9999
} else {
100100
result.push(
101-
`import${this.isTypeImports ? " type" : ""} { ${symbols.join(",")} } from "${key}";`,
101+
`import${this.isTypeImports ? " type" : ""} { ${symbols.join(", ")} } from "${key}";`,
102102
);
103103
}
104104
}

packages/code-gen/src/validators/javascript.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ export function validatorJavascriptArray(file, type, validatorState) {
548548
fileWrite(file, `/** @type {any|any[]} */`);
549549
fileWrite(
550550
file,
551-
`let intermediateValue${validatorState.reusedVariableIndex} = ${valuePath};\n`,
551+
`${type.validator.convert ? "let" : "const"} intermediateValue${validatorState.reusedVariableIndex} = ${valuePath};\n`,
552552
);
553553
}
554554

0 commit comments

Comments
 (0)