Skip to content

Commit 2ec9cf7

Browse files
committed
chore: lint
1 parent 947ead8 commit 2ec9cf7

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

lib/build.ts

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function build(
1515

1616
const banner = `
1717
/**
18-
* This file is auto generated by @block65/openapi-codegen
18+
* This file was auto generated by @block65/openapi-codegen
1919
*
2020
* WARN: Do not edit directly.
2121
*
@@ -29,28 +29,21 @@ export async function build(
2929
tags,
3030
);
3131

32-
commandsFile.insertStatements(0, banner);
33-
typesFile.insertStatements(0, banner);
34-
clientFile.insertStatements(0, banner);
35-
36-
commandsFile.formatText();
37-
typesFile.formatText();
38-
clientFile.formatText();
39-
40-
await commandsFile.save();
41-
await typesFile.save();
42-
await clientFile.save();
43-
44-
await Promise.all(
45-
[commandsFile, commandsFile].map(async (file) =>
46-
writeFile(
47-
file.getFilePath(),
48-
await format(commandsFile.getText(), { parser: 'typescript' }),
49-
),
50-
),
51-
);
32+
const files = [commandsFile, typesFile, clientFile];
33+
34+
commandsFile.insertStatements(0, '/** eslint-disable max-classes */');
35+
36+
// eslint-disable-next-line no-restricted-syntax
37+
for await (const file of files) {
38+
file.insertStatements(0, banner);
39+
file.formatText();
40+
41+
await file.save();
42+
5243
const data = await prettier(file.getFullText(), {
5344
parser: 'typescript',
5445
...prettierConfig,
5546
});
47+
await writeFile(file.getFilePath(), data);
48+
}
5649
}

0 commit comments

Comments
 (0)