Start a TypeScript Node project

Step 1 - Install TypeScript

Install TypeScript

<pre v-pre data-lang=""><code class="lang-">pnpm add -D typescript</code></pre>

Init TypeScript project

<pre v-pre data-lang=""><code class="lang-">pnpx/npx tsc --init</code></pre>

Step 2 - Using Google TypeScript Style to Lint and Correct Code

You can find more details at Google TypeScript Style.

Install gts

<pre v-pre data-lang=""><code class="lang-">pnpm add -D gts</code></pre>

Init gts

<pre v-pre data-lang=""><code class="lang-">pnpx/npx gts init</code></pre>

Step 3 - A list of useful TypeScript Libraries

  • tsx - TypeScript execution and REPL for node.js with source map and native ESM support. More details at here.