Skip to content

Commit f8de721

Browse files
authored
chore: fix lint warning (#657)
1 parent 7f7336b commit f8de721

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sources/main.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ function getPackageManagerRequestFromCli(parameter: string | undefined, engine:
3838
};
3939
}
4040

41+
function isUsageError(error: any): error is UsageError {
42+
return error?.name === `UsageError`;
43+
}
44+
4145
export async function runMain(argv: Array<string>) {
4246
const engine = new Engine();
4347

@@ -85,8 +89,8 @@ export async function runMain(argv: Array<string>) {
8589
cwd: process.cwd(),
8690
args: restArgs,
8791
});
88-
} catch (error: UsageError | any) {
89-
if (error?.name === `UsageError`) {
92+
} catch (error) {
93+
if (isUsageError(error)) {
9094
console.error(error.message);
9195
process.exit(1);
9296
}

0 commit comments

Comments
 (0)