From aaefe69287eed6da8fbc8c9dee7a418dce265579 Mon Sep 17 00:00:00 2001 From: Vasiliy Vanchuk Date: Tue, 19 Feb 2019 15:27:43 +0400 Subject: [PATCH 1/3] Fix command for initializing tsconfig Project dependency doesn't add itself it global PATH. So call `tsc` will work either with globally installed typescript, or from npm/yarn script. --- content/docs/static-type-checking.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/static-type-checking.md b/content/docs/static-type-checking.md index b01b92fe..fd55d8bb 100644 --- a/content/docs/static-type-checking.md +++ b/content/docs/static-type-checking.md @@ -219,7 +219,7 @@ Congrats! You've installed the latest version of TypeScript into your project. I The compiler is of no help to us until we tell it what to do. In TypeScript, these rules are defined in a special file called `tsconfig.json`. To generate this file run: ```bash -tsc --init +npx tsc --init ``` Looking at the now generated `tsconfig.json`, you can see that there are many options you can use to configure the compiler. For a detailed description of all the options, check [here](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html). From 67167457763fac15d0429eb443e8870179b3fe60 Mon Sep 17 00:00:00 2001 From: Vasiliy Vanchuk Date: Tue, 19 Feb 2019 18:42:05 +0400 Subject: [PATCH 2/3] Update static-type-checking.md --- content/docs/static-type-checking.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/content/docs/static-type-checking.md b/content/docs/static-type-checking.md index fd55d8bb..553ea635 100644 --- a/content/docs/static-type-checking.md +++ b/content/docs/static-type-checking.md @@ -216,9 +216,17 @@ Congrats! You've installed the latest version of TypeScript into your project. I ``` ### Configuring the TypeScript Compiler {#configuring-the-typescript-compiler} -The compiler is of no help to us until we tell it what to do. In TypeScript, these rules are defined in a special file called `tsconfig.json`. To generate this file run: +The compiler is of no help to us until we tell it what to do. In TypeScript, these rules are defined in a special file called `tsconfig.json`. To generate this file: -```bash +If you use [Yarn](https://yarnpkg.com/), run: + +```shell +yarn run tsc --init +``` + +If you use [npm](https://www.npmjs.com/), run: + +```shell npx tsc --init ``` From 0948bf553eac307d48622e4275953baf83dc1bcf Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Wed, 20 Feb 2019 01:48:07 +0300 Subject: [PATCH 3/3] Update static-type-checking.md --- content/docs/static-type-checking.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/static-type-checking.md b/content/docs/static-type-checking.md index 553ea635..0f459aa8 100644 --- a/content/docs/static-type-checking.md +++ b/content/docs/static-type-checking.md @@ -220,13 +220,13 @@ The compiler is of no help to us until we tell it what to do. In TypeScript, the If you use [Yarn](https://yarnpkg.com/), run: -```shell +```bash yarn run tsc --init ``` If you use [npm](https://www.npmjs.com/), run: -```shell +```bash npx tsc --init ```