From 1a8b3f8090976980da625b5a67a98abdf85a1721 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 23 Jun 2019 14:15:37 +0000 Subject: [PATCH 1/3] build(deps-dev): bump tslint from 5.11.0 to 5.18.0 Bumps [tslint](https://github.com/palantir/tslint) from 5.11.0 to 5.18.0. - [Release notes](https://github.com/palantir/tslint/releases) - [Changelog](https://github.com/palantir/tslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/palantir/tslint/compare/5.11.0...5.18.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 57 +++++++++-------------------------------------- package.json | 2 +- 2 files changed, 11 insertions(+), 48 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f94846..eb3c4ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1118,44 +1118,6 @@ "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", "dev": true }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, "babel-jest": { "version": "24.3.1", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.3.1.tgz", @@ -7227,29 +7189,30 @@ } }, "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", "dev": true }, "tslint": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.11.0.tgz", - "integrity": "sha1-mPMMAurjzecAYgHkwzywi0hYHu0=", + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz", + "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==", "dev": true, "requires": { - "babel-code-frame": "^6.22.0", + "@babel/code-frame": "^7.0.0", "builtin-modules": "^1.1.1", "chalk": "^2.3.0", "commander": "^2.12.1", "diff": "^3.2.0", "glob": "^7.1.1", - "js-yaml": "^3.7.0", + "js-yaml": "^3.13.1", "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", "resolve": "^1.3.2", "semver": "^5.3.0", "tslib": "^1.8.0", - "tsutils": "^2.27.2" + "tsutils": "^2.29.0" } }, "tsutils": { diff --git a/package.json b/package.json index 9f896be..a882159 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "ts-jest": "^24.0.2", "ts-loader": "^6.0.4", "ts-node": "^8.3.0", - "tslint": "^5.11.0", + "tslint": "^5.18.0", "typescript": "^3.0.3" }, "dependencies": { From 67093f41e7af3bf8c95d2d23c9b8fe4a1b05373e Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 24 Jun 2019 00:31:43 +1000 Subject: [PATCH 2/3] refactor(lint): refactoring code to address new lint rules --- package-lock.json | 6 +++--- src/commander.ts | 4 ++-- src/types.ts | 10 +++------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index eb3c4ad..368b0da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3707,7 +3707,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { @@ -3720,7 +3720,7 @@ }, "lodash": { "version": "3.10.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "resolved": "http://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", "dev": true }, @@ -7448,7 +7448,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { diff --git a/src/commander.ts b/src/commander.ts index 4230230..d0ec5ad 100644 --- a/src/commander.ts +++ b/src/commander.ts @@ -73,14 +73,14 @@ function getParams( } function instantiateCommand(command: CommandDefinition) { - const constructor = command.type as { new(...args: any[]): Command }; + const constructor = command.type; const instance = iocContainer ? iocContainer.get(constructor) : new constructor(); return instance; } function registerCommandOption( cliCommand: cli.Command, - paramsClass: { new(...args: any[]): any; }, + paramsClass: new (...args: any[]) => any, option: CommandOptionDefinition ) { const optionUsage = getOptionUsage(option); diff --git a/src/types.ts b/src/types.ts index 257ad02..b11d67a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -30,14 +30,10 @@ export interface Command { execute(params: TParams): Promise | void; } -export interface CommandParamsClass { - new(): T; -} +export type CommandParamsClass = new () => T; -export interface CommandClass { - new(...args: any[]): Command; -} +export type CommandClass = new (...args: any[]) => Command; export interface IocContainer { - get: (Class: { new(...args: any[]): T }) => T; + get: (Class: new (...args: any[]) => T) => T; } From 392eb754f611ba20a1e1bfce1dd903d3ca06a946 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 24 Jun 2019 00:34:03 +1000 Subject: [PATCH 3/3] chore(jest): fix deprecated config in jest.config.js --- jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index deabd39..7e89b4a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -67,7 +67,7 @@ module.exports = { // A set of global variables that need to be available in all test environments globals: { "ts-jest": { - "tsConfigFile": "tsconfig.tests.json" + "tsConfig": "tsconfig.tests.json" } },