From 4d3a3529b8382b359c323c58a5dd1c6a7bb80540 Mon Sep 17 00:00:00 2001 From: Kim Biesbjerg Date: Mon, 16 Sep 2019 20:38:23 +0200 Subject: [PATCH] add typeRoots --- src/cli/cli.ts | 9 +++++---- tsconfig.json | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/cli/cli.ts b/src/cli/cli.ts index 3dc4345..bc25101 100755 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -25,12 +25,13 @@ export const cli = yargs .option('input', { alias: 'i', describe: 'Paths you would like to extract strings from. You can use path expansion, glob patterns and multiple paths', - default: process.env.PWD, + default: [process.env.PWD], type: 'array', - normalize: true + normalize: true, + required: true }) .check(options => { - (options.input as unknown as string[]).forEach((dir: string) => { + options.input.forEach((dir: string) => { if (!fs.existsSync(dir) || !fs.statSync(dir).isDirectory()) { throw new Error(`The path you supplied was not found: '${dir}'`); } @@ -98,7 +99,7 @@ export const cli = yargs .exitProcess(true) .parse(process.argv); -const extractTask = new ExtractTask(cli.input as unknown as string[], cli.output, { +const extractTask = new ExtractTask(cli.input, cli.output, { replace: cli.replace, patterns: cli.patterns }); diff --git a/tsconfig.json b/tsconfig.json index b9ebab9..8e2a007 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,10 @@ ], "module": "commonjs", "outDir": "./dist/", - "sourceMap": true + "sourceMap": true, + "typeRoots" : [ + "./node_modules/@types" + ], }, "include": [ "src/**/*.ts"