Skip to content

Latest commit

 

History

History
65 lines (49 loc) · 1.07 KB

README.md

File metadata and controls

65 lines (49 loc) · 1.07 KB

TS Leftpad example

TSC config

Setup TS project:

Option 1: Using tsc cli

tsc --init

Using tsc cli, a default tsconfig is created with the following config:

target: es2016
module: commonjs
strict: true
esModuleInterop: true
skipLibCheck: true
forceConsistentCasingInFileNames: true

Option 2: Create tsconfig

Create tsconfig.json with the following recommended options for the following sample project:

{
  "compilerOptions": {
    "strict": true,
    "target": "es2016",
    "module": "ESNext",
    "moduleResolution": "node",
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "noEmit": true,
    "isolatedModules": true
  }
}

Eslint & Prettier

For more information please visit the detailed vanilla TS project setup for more help

Initialize pnpm

pnpm init

Install ESlint & Prettier

pnpm i -D eslint \
    eslint-config-prettier \
    eslint-plugin-prettier \
    prettier

Watch using tsc

tsc -w