Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Introduction

This package provides the shared TypeScript configurations for the entire FRAME monorepo. Each preset targets a specific runtime environment and extends a strictly typed base set of compiler options.

PresetImport pathRecommended use
base@frame/tsconfig/baseBase for all presets. Do not use directly.
next@frame/tsconfig/nextNext.js applications with App Router
nest@frame/tsconfig/nestNestJS applications with decorators
node@frame/tsconfig/nodeNode.js scripts and CLIs
react-library@frame/tsconfig/react-libraryReact libraries without a framework

All presets extend base.json and only override the options required for their environment:

graph TD
  base["base.json"] --> next["next.json"]
  base --> nest["nest.json"]
  base --> node["node.json"]
  base --> react["react-library.json"]

The base preset sets the following compiler options as the starting point for all packages:

OptionValuePurpose
stricttrueEnables all strict TypeScript checks
noImplicitAnytrueForbids implicit any
strictNullCheckstrueDistinguishes null and undefined from other types
noUnusedLocalstrueErrors on unused local variables
noUnusedParameterstrueErrors on unused function parameters
noImplicitOverridetrueRequires the override keyword when overriding methods
noImplicitReturnstrueRequires an explicit return on all branches
noFallthroughCasesInSwitchtrueForbids fallthrough in switch
targetes2022Modern compilation target
moduleesnextNative ES modules
moduleResolutionbundlerResolution optimized for modern bundlers
isolatedModulestrueCompatible with per-file transpilation (esbuild, SWC)
incrementaltrueIncremental compilation for speed
resolveJsonModuletrueAllows importing .json files
skipLibChecktrueSkips type checking of third-party .d.ts files
erasableSyntaxOnlyfalseAllows non-erasable TypeScript syntax (decorators)

Extends base and enables the Next.js plugin for IDE analysis:

next.json
{
"extends": "./base.json",
"compilerOptions": {
"jsx": "react-jsx",
"plugins": [{ "name": "next" }]
}
}
    1. Add the package as a development dependency:
      package.json
      {
      "devDependencies": {
      "@frame/tsconfig": "workspace:*"
      }
      }
    2. Create a tsconfig.json at the package root and extend the appropriate preset:
      tsconfig.json
      {
      "extends": "@frame/tsconfig/base",
      "compilerOptions": {
      "outDir": "dist"
      },
      "include": ["src"],
      "exclude": ["node_modules", "dist"]
      }
    3. Select the correct preset for the environment:
    EnvironmentPreset
    Next.js@frame/tsconfig/next
    NestJS@frame/tsconfig/nest
    Node.js / CLI@frame/tsconfig/node
    React library@frame/tsconfig/react-library