Opinionated template for TypeScript libraries. ESM-only, strict types, fast tooling.
- Language: TypeScript 7, base config from
@2bad/tsconfig - Build: tsdown (Rolldown + oxc)
- Test: Vitest with v8 coverage (80% thresholds enforced)
- Lint: oxlint with the
@2bad/axiomruleset - Format: oxfmt
- Post-build: publint + arethetypeswrong, run as part of
pnpm build - CI: GitHub Actions (Linux + Windows, Node 26), CodeQL, Renovate
- Publish: npm trusted publishing with provenance on GitHub release
- Click Use this template on GitHub
- Clone your new repository
- Search and replace:
ts-lib-starterwith your package name2BADwith your name/organization (keep@2bad/tsconfigand@2bad/axiomas-is)
- Update
authorandcontributorsinpackage.json pnpm install
pnpm build # compile to ESM + generate .d.ts, then validate with publint + attw
pnpm test # run all tests
pnpm test:unit # unit tests with coverage
pnpm test:integration # integration tests with coverage
pnpm check # lint + format check + type check
pnpm fix # auto-fix lint + formattingsource/ # source code, tests co-located
build/ # compiled output (generated)
test:unitandtest:integrationfilter by filename, so name test files*.unit.test.tsor*.integration.test.ts.~/is an alias forsource/. Imports use.tsextensions.- The build keeps the source file tree, so every public entry point needs a matching block in
package.jsonexports(see./quotes/parts).
Configure the package as a trusted publisher on npm for the publish.yml
workflow, then create a GitHub release. Prerelease versions such as 1.1.0-beta.0 are published under the matching
dist-tag (beta), everything else under latest.
- Node.js >= 26
- pnpm >= 12
MIT