TypeScript Tooling
TypeScript Tooling: Linting, Testing, and Bundling Workflow
Great TypeScript tooling combines four distinct tools: tsc for type checking, typescript-eslint for logic rules, Prettier for formatting, and a fast runtime or bundler like Vitest, Vite, or tsup. Each tool solves a different problem so none gets bloated.
Modern bundlers like Vite and Next.js strip types for speed rather than running full type checks during dev reloads—so running tsc --noEmit in your scripts and CI pipeline remains essential.
Recommended package.json Scripts
Wire formatting, linting, type checking, and unit tests into simple npm scripts every contributor can run before pushing.
{
"scripts": {
"typecheck": "tsc --noEmit",
"lint": "eslint .",
"format": "prettier --check .",
"test": "vitest run",
"build": "tsup src/index.ts --dts --format esm,cjs"
}
}
Type-Aware Linting with typescript-eslint
While tsc validates types, typescript-eslint catches runtime pitfalls such as floating Promises (@typescript-eslint/no-floating-promises) where you forgot await on an async call, or accidental [object Object] stringification.
Common Mistakes to Avoid
- Turning on conflicting ESLint formatting rules alongside Prettier: Always add
eslint-config-prettierlast in your ESLint config so ESLint never fights Prettier over indentation or semicolons. - Skipping
tsc --noEmitbecause Vite/esbuild built cleanly: Esbuild and SWC strip types without checking them, letting broken types pass dev builds silently. - Using slow legacy
ts-jestsetups on modern ESM repos:vitestsupports TypeScript, ESM, and path aliases out of the box with zero extra config.
Frequently Asked Questions
What does tsup do compared to tsc?
tsup (powered by esbuild) bundles TypeScript npm packages into ESM and CJS files in milliseconds and automatically runs tsc to emit .d.ts type declarations.
Should I format code with Prettier or Biome?
Both work well. Prettier has the widest ecosystem support, while Biome replaces both ESLint and Prettier in a single fast Rust binary.
How does VS Code pick up my project's TypeScript version?
VS Code ships its own TypeScript version, so click the TypeScript version number in the bottom status panel and choose Use Workspace Version so editor diagnostics match npm run typecheck.
Unlock Your
Full Potential.
Sign in to track your learning journey, earn industry-recognized certificates, and join our elite developer community.
Quick Access With
Try it Yourself
Experiment with the code from this lesson in our interactive playground.