Skip to content

Typescript

Install

pnpm i -D typescript @tsconfig/recommended

Configuration

{
    "extends": "@tsconfig/recommended/tsconfig.json",
    "compilerOptions": {
        "jsx": "react-jsx"
    },
    "include": ["src/**/*"],
    "exclude": ["node_modules"]
}

TSConfig Bases

JSX Support

Use the react-jsx option to use the new JSX transform.

Concepts

Typecheck only

tsc --noEmit src/

Tools

tsx - Run Typescript files with esbuild

pnpm i -g tsx
tsx file.ts

swc-node - Fast TypeScript transformer for node

Resources


Last update: August 12, 2023
Created: June 3, 2023