Skip to content

Commit 00304bc

Browse files
committed
fix(cli): cleanup code and add missing dependencies
1 parent e37133c commit 00304bc

File tree

4 files changed

+7
-40
lines changed

4 files changed

+7
-40
lines changed

@commitlint/cli/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
},
3737
"license": "MIT",
3838
"devDependencies": {
39+
"@types/execa": "^0.9.0",
3940
"@types/yargs": "^15.0.3",
41+
"@commitlint/test": "8.2.0",
42+
"@commitlint/utils": "^8.3.4",
4043
"execa": "0.11.0",
4144
"fs-extra": "^8.1.0"
4245
},

@commitlint/cli/src/cli.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface TestOptions {
1111
env?: Record<string, string>;
1212
}
1313

14-
function cli(args: string[], options: TestOptions) {
14+
const cli = (args: string[], options: TestOptions) => {
1515
return (input = '') => {
1616
const c = execa(bin, args, {
1717
cwd: options.cwd,
@@ -20,7 +20,7 @@ function cli(args: string[], options: TestOptions) {
2020
});
2121
return c.catch(err => err);
2222
};
23-
}
23+
};
2424

2525
const gitBootstrap = (fixture: string) => git.bootstrap(fixture, __dirname);
2626
const fixBootstrap = (fixture: string) => fix.bootstrap(fixture, __dirname);

@commitlint/cli/src/cli.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ const cli = yargs
103103
`[input] reads from stdin if --edit, --env, --from and --to are omitted`
104104
).argv;
105105

106-
main(cli).catch(err =>
106+
main(cli).catch(err => {
107107
setTimeout(() => {
108108
if (err.type === pkg.name) {
109109
process.exit(1);
110110
}
111111
throw err;
112112
}, 0)
113-
);
113+
});
114114

115115
async function main(options: CliFlags) {
116116
const raw = options._;

@commitlint/cli/src/help.ts

-36
This file was deleted.

0 commit comments

Comments
 (0)