TypeScript
Installation
Section titled “Installation”To install:
npm i -D typescriptyarn add -D typescriptpnpm add -D typescriptbun add -d typescriptConfiguration
Section titled “Configuration”{ "$schema": "https://json.schemastore.org/tsconfig.json", "compilerOptions": { /* Base Options: */ "esModuleInterop": true, "skipLibCheck": true, "target": "es2022", "allowJs": true, "resolveJsonModule": true, "moduleDetection": "force", "isolatedModules": true, /* Strictness */ "strict": true, "noUncheckedIndexedAccess": true, /* If transpiling with TypeScript: */ "moduleResolution": "NodeNext", "module": "NodeNext", "outDir": "dist", "sourceMap": true, /* AND if you're building for a library: */ "declaration": true, /* AND if you're building for a library in a monorepo: */ "composite": true, "declarationMap": true, /* If NOT transpiling with TypeScript: "moduleResolution": "Bundler", "module": "ESNext", */ "noEmit": true, /* If your code runs in the DOM: */ "lib": ["es2022", "dom", "dom.iterable"] /* If your code doesn't run in the DOM: "lib": ["es2022"] */ }}Credits: This is shamelessly sourced from Matt Pocock at TotalTypeScript
Here is a script to run the typescript compiler to typecheck a TS project:
# File: package.json
"typecheck": "tsc --noEmit",Documentation
Section titled “Documentation”See the well crafted documentation and its Cheat Sheet