Skip to content

Commit

Permalink
fix(code-gen): add trailing comma in multi-line imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkdev98 committed Oct 23, 2024
1 parent 0852288 commit e7fb6a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/code-gen/src/target/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ export class JavascriptImportCollector {

if (isMultiline) {
result.push(
`import${this.isTypeImports ? " type" : ""} {\n ${symbols.join(",\n ")}\n} from "${key}";`,
`import${this.isTypeImports ? " type" : ""} {\n ${symbols.join(",\n ")},\n} from "${key}";`,
);
} else {
result.push(
`import${this.isTypeImports ? " type" : ""} { ${symbols.join(",")} } from "${key}";`,
`import${this.isTypeImports ? " type" : ""} { ${symbols.join(", ")} } from "${key}";`,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/code-gen/src/validators/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ export function validatorJavascriptArray(file, type, validatorState) {
fileWrite(file, `/** @type {any|any[]} */`);
fileWrite(
file,
`let intermediateValue${validatorState.reusedVariableIndex} = ${valuePath};\n`,
`${type.validator.convert ? "let" : "const"} intermediateValue${validatorState.reusedVariableIndex} = ${valuePath};\n`,
);
}

Expand Down

0 comments on commit e7fb6a6

Please sign in to comment.