Skip to content

Commit b722887

Browse files
renovate[bot]renovate-botKingDarBoja
authored
fix(deps): update dependency commander to v6 (#641)
* fix(deps): update dependency commander to v6 * fix: now use command.opts to retrieve version Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: KingDarBoja <[email protected]>
1 parent e835b1f commit b722887

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

package-lock.json

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"dependencies": {
1313
"chalk": "4.1.0",
14-
"commander": "5.1.0",
14+
"commander": "6.0.0",
1515
"eslint-config-prettier": "6.11.0",
1616
"glob": "7.1.6",
1717
"strip-json-comments": "3.1.1",

src/cli/runCli.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const runCli = async (
1818
rawArgv: string[],
1919
): Promise<ResultStatus> => {
2020
const command = new Command()
21+
.storeOptionsAsProperties(false)
2122
.usage("[options] <file ...> --language [language]")
2223
.option(
2324
"--comments [files]",
@@ -30,14 +31,15 @@ export const runCli = async (
3031
.option("--prettier [prettier]", "add eslint-config-prettier to the plugins list")
3132
.option("--tslint [tslint]", "tslint configuration file to convert using")
3233
.option("--typescript [typescript]", "typescript configuration file to convert using")
33-
.option("-V --version", "output the package version");
34+
.option("-V, --version", "output the package version");
3435

3536
const parsedArgv = {
3637
config: "./.eslintrc.js",
3738
...(command.parse(rawArgv) as Partial<TSLintToESLintSettings>),
3839
};
3940

40-
if ({}.hasOwnProperty.call(parsedArgv, "version")) {
41+
const programOptions = command.opts();
42+
if (programOptions.version) {
4143
dependencies.logger.stdout.write(`${version}${EOL}`);
4244
return ResultStatus.Succeeded;
4345
}

0 commit comments

Comments
 (0)