Skip to content

Commit

Permalink
fix: require arguments to hook and command
Browse files Browse the repository at this point in the history
now possible with TS 3.0
  • Loading branch information
jdx committed Sep 14, 2018
1 parent 75825f1 commit 38982b5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"author": "Jeff Dickey @jdxcode",
"bugs": "https://github.com/oclif/test/issues",
"dependencies": {
"fancy-test": "^1.4.0"
"fancy-test": "^1.4.1"
},
"devDependencies": {
"@oclif/command": "^1.5.0",
"@oclif/config": "^1.7.5",
"@oclif/config": "^1.7.6",
"@oclif/errors": "^1.2.0",
"@oclif/tslint": "^3.1.0",
"@types/chai": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as Config from '@oclif/config'

import {loadConfig} from './load-config'

export function command(args: string[] | string | undefined, opts: loadConfig.Options = {}) {
export function command(args: string[] | string, opts: loadConfig.Options = {}) {
return {
async run(ctx: {config: Config.IConfig, expectation: string}) {
if (!ctx.config || opts.reset) ctx.config = await loadConfig(opts).run({} as any)
Expand Down
2 changes: 1 addition & 1 deletion src/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {loadConfig} from './load-config'
* @param event - hook to run
* @param hookOpts - options to pass to hook. Config object will be passed automatically.
*/
export default (event?: string, hookOpts: object = {}, options: loadConfig.Options = {}) => ({
export default (event: string, hookOpts: object = {}, options: loadConfig.Options = {}) => ({
async run(ctx: {config: Config.IConfig, expectation: string}) {
if (!event) throw new Error('no hook provided')
if (!ctx.config) ctx.config = await loadConfig(options).run({} as any)
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
debug "^3.1.0"
semver "^5.5.0"

"@oclif/config@^1.7.5":
version "1.7.5"
resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.7.5.tgz#df302da3b6f590b0c6cc8a515bf97e746ec513b8"
"@oclif/config@^1.7.6":
version "1.7.6"
resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.7.6.tgz#849e5f79591c8dd29d99dd3aba0914b50e2c2e74"
dependencies:
debug "^4.0.1"
tslib "^1.9.3"
Expand Down Expand Up @@ -451,17 +451,17 @@ extglob@^2.0.4:
snapdragon "^0.8.1"
to-regex "^3.0.1"

fancy-test@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-1.4.0.tgz#93e8b1904afbcefb496f58a05f6d2d99fc9c4acc"
fancy-test@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-1.4.1.tgz#c87267e01c71185ef4cd5a9cf508eb7e3adbdc94"
dependencies:
"@types/chai" "^4.1.4"
"@types/lodash" "^4.14.116"
"@types/mocha" "^5.2.5"
"@types/nock" "^9.3.0"
"@types/node" "^10.9.4"
"@types/sinon" "^5.0.2"
lodash "^4.17.10"
lodash "^4.17.11"
mock-stdin "^0.3.1"
stdout-stderr "^0.1.9"

Expand Down Expand Up @@ -781,7 +781,7 @@ kind-of@^6.0.0, kind-of@^6.0.2:
version "6.0.2"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051"

lodash@^4.17.10:
lodash@^4.17.11:
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"

Expand Down

0 comments on commit 38982b5

Please sign in to comment.