Skip to content

Commit 9c9af24

Browse files
authored
fix: Update prettier version to 3.2.5 (#237)
* fix: Update prettier version to 3.2.5 * fix: await prettier format
1 parent c8152b9 commit 9c9af24

File tree

5 files changed

+20
-15
lines changed

5 files changed

+20
-15
lines changed

cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"ink": "^3.2.0",
4747
"js-yaml": "^4.1.0",
4848
"openapi3-ts": "^2.0.1",
49-
"prettier": "^3.0.3",
49+
"prettier": "^3.2.5",
5050
"rxjs": "^7.5.4",
5151
"slash": "^4.0.0",
5252
"swagger2openapi": "^7.0.8",

cli/src/commands/GenerateCommand.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,14 @@ export class GenerateCommand extends Command {
233233
const prettierConfig = await prettier.resolveConfig(process.cwd());
234234

235235
const writeFile = async (file: string, data: string) => {
236+
const updatedConfig = await prettier.format(data, {
237+
parser: "babel-ts",
238+
...prettierConfig,
239+
});
240+
236241
await fsExtra.outputFile(
237242
path.join(process.cwd(), config.outputDir, file),
238-
prettier.format(data, { parser: "babel-ts", ...prettierConfig })
243+
updatedConfig
239244
);
240245
};
241246

cli/src/commands/InitCommand.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ export class InitCommand extends Command {
140140
source === "file"
141141
? await this.askForFile()
142142
: source === "url"
143-
? await this.askForUrl()
144-
: await this.prompt.github("todo: inject the token");
143+
? await this.askForUrl()
144+
: await this.prompt.github("todo: inject the token");
145145

146146
const namespace = format.camel(
147147
await this.prompt.input({
@@ -188,7 +188,7 @@ export class InitCommand extends Command {
188188

189189
const prettierConfig = await prettier.resolveConfig(process.cwd());
190190

191-
const updatedConfig = prettier.format(
191+
const updatedConfig = await prettier.format(
192192
printer.printFile(updatedConfigSourceFile),
193193
{ parser: "babel-ts", ...prettierConfig }
194194
);

package-lock.json

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"husky": "^7.0.2",
3131
"jest": "^27.2.5",
3232
"lerna": "^5.5.0",
33-
"prettier": "^3.0.3",
33+
"prettier": "^3.2.5",
3434
"pretty-quick": "^3.1.1",
3535
"typescript": "4.8.2"
3636
},

0 commit comments

Comments
 (0)