From f9a18bfd624a5013108084f690cd8a1de794c430 Mon Sep 17 00:00:00 2001 From: Mael Le Guen Date: Sun, 22 Dec 2019 19:26:11 +0100 Subject: [PATCH] fix(docs): use recommended cjs import syntax for ts examples (#1513) --- docs/typescript.md | 4 +--- docs/webpack.md | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/typescript.md b/docs/typescript.md index 36ef4a2a8..5baf9b8f1 100644 --- a/docs/typescript.md +++ b/docs/typescript.md @@ -7,9 +7,7 @@ The following `.options()` definition: ```typescript #!/usr/bin/env node -import * as yargs from 'yargs'; -// or with the "esModuleInterop" compiler option set to "true": -// import yargs from 'yargs'; +import yargs = require('yargs'); const argv = yargs.options({ a: { type: 'boolean', default: false }, diff --git a/docs/webpack.md b/docs/webpack.md index b665b5331..012a846e0 100644 --- a/docs/webpack.md +++ b/docs/webpack.md @@ -23,7 +23,7 @@ console.log(yargs.parse()) Or for typescript users, `src/index.ts`: ```ts -import * as yargs from 'yargs'; +import yargs = require('yargs'); console.log(yargs.parse()); ```