@v4/typescript-config
The shared tsconfig presets: a strict base plus Next.js and React-library variants that every workspace extends.
Overview
@v4/typescript-config is the shared TypeScript preset for the monorepo. It
ships three tsconfig files — a strict base and two consumption variants — that
every workspace extends, so type-checking is uniform across apps and packages on
TypeScript 5.9.
The package publishes nothing and has no build: it is a workspace:* dev
dependency whose only contents are the three JSON files it exposes via files.
The three presets
| File | Extends | For |
|---|---|---|
@v4/typescript-config/base.json |
— | The strict foundation both variants build on |
@v4/typescript-config/nextjs.json |
base.json |
Next.js apps (apps/web, apps/docs) |
@v4/typescript-config/react-library.json |
base.json |
React component libraries (the Ghost packages) |
base.json sets the house strictness: strict on, plus
noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitOverride,
noImplicitReturns, noFallthroughCasesInSwitch,
noPropertyAccessFromIndexSignature, and no unreachable/unused code — on top of
NodeNext resolution, isolatedModules and declaration output with maps.
nextjs.json swaps in the DOM libs, ESNext / Bundler resolution, the
next plugin, jsx: "preserve" and noEmit. react-library.json uses the
same DOM libs and Bundler resolution but jsx: "react-jsx" and emits
declarations.
How a workspace consumes it
Each package's tsconfig.json extends the appropriate variant and adds only what
is local to it:
// packages/ghost-core/tsconfig.json
{
"extends": "@v4/typescript-config/react-library.json",
"compilerOptions": { "noEmit": true },
"include": ["src", "vitest.config.ts", "vitest.setup.ts", "eslint.config.mjs"],
"exclude": ["node_modules", "dist"],
}
// apps/web/tsconfig.json
{
"extends": "@v4/typescript-config/nextjs.json",
"compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["./src/*"] } },
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"eslint.config.mjs",
"next.config.ts",
],
"exclude": ["node_modules"],
}
pnpm check-types runs tsc --noEmit per workspace and is Turbo-cached at the
repo root — see Monorepo and packages.
The type-aware ESLint base in @v4/eslint-config
relies on these same tsconfigs covering the linted files.