Skip to content

OzzyCzech/tsconfig

Repository files navigation

@ozzyczech/tsconfig

Shared TypeScript config for my projects. Two variants: a strict Node.js / Bun library preset (default) and a DOM / browser preset for bundler-based apps.

Install

npm install --save-dev @ozzyczech/tsconfig
yarn add --dev @ozzyczech/tsconfig
pnpm add -D @ozzyczech/tsconfig
bun add -d @ozzyczech/tsconfig

Usage

Node.js / Bun library (default)

Strict Node ESM: module and moduleResolution set to nodenext, lib: ["ES2024"], no DOM, no JSX.

{
	"extends": "@ozzyczech/tsconfig",
	"include": ["src/**/*"]
}

DOM / browser / React

Extends the base and adds DOM + DOM.Iterable libs, jsx: "react-jsx", and moduleResolution: "bundler" for Vite / esbuild / Next / Bun.

{
	"extends": "@ozzyczech/tsconfig/dom",
	"include": ["src/**/*"]
}

What's enabled

Both variants share these strict compiler options:

  • strict, noImplicitReturns, noImplicitOverride
  • noUnusedLocals, noUnusedParameters
  • noFallthroughCasesInSwitch, noUncheckedIndexedAccess, noUncheckedSideEffectImports
  • erasableSyntaxOnly — disallows enum, parameter properties, namespace; keeps code compatible with type-stripping runtimes (Node 22+, Bun, tsx)
  • isolatedModules — every file must be transpilable in isolation (required by esbuild, swc, Babel)
  • declaration, stripInternal — emits clean .d.ts suitable for libraries
  • resolveJsonModule, esModuleInterop, allowSyntheticDefaultImports
  • skipLibCheck, incremental

The output directory defaults to ${configDir}/dist and is excluded from compilation.

Releasing

Push a semver tag — the publish.yml workflow builds, publishes to npm with provenance, and creates a GitHub Release from commit messages.

git tag v2.0.0 && git push origin v2.0.0