---
description: 設定 TypeScript 編輯環境
---

# Setup

## 設定 TypeScript 編輯環境 <a href="#setup" id="setup"></a>

```c
// 1. install Node.js & check
node --version        // 14.15.4 (as of 2021)

// 2. install npm (along with Node.js) & check
npm --version         // 6.14.10

// 3. install Git (optional) & check
git --version         // 2.30.0

// 4. install TypeScript & check
npm install --global typescript@4.2.2
tsc --version         // 4.2.2
```

## 設定 TypeScript Compiler

{% tabs %}
{% tab title="📗 參考" %}
* compiler flag: [noImplicitAny](https://www.typescriptlang.org/tsconfig#noImplicitAny), [strictNullCheck](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#strictnullchecks-on)
{% endtab %}
{% endtabs %}

```c
// when type not specified, compiler will default to `any`.
noImplicitAny = on

// check null or undefined
strictNullChecks = on
```

