Configuration

Configuration reference for forge-ts

forge-ts is configured through a single forge-ts.config.ts file in your project root. The configuration controls TSDoc enforcement rules, documentation generation, doctest execution, OpenAPI output, and AI context file generation.

forge-ts.config.ts

Create a forge-ts.config.ts file in your project root:

import { defineConfig } from "@forge-ts/core";

export default defineConfig({
  rootDir: ".",
  outDir: "docs/generated",
  enforce: {
    enabled: true,
    rules: { E001: "error", E016: "error" },
  },
  gen: {
    enabled: true,
    formats: ["markdown"],
    llmsTxt: true,
  },
  doctest: { enabled: true },
});

BypassConfig

Configuration for the bypass budget system.

PropertyTypeRequiredDescription
dailyBudgetnumberYesMaximum number of bypasses allowed per calendar day. Default: 3
durationHoursnumberYesDuration in hours before a bypass automatically expires. Default: 24

Enforcement Rules

forge-ts ships with 40 enforcement rules: 20 error-level (E001-E020) and 20 warning-level (W001-W020). Configure them in the enforce.rules object.

CodeRuleSeverityDescription
E001require-summaryerrorExported symbol missing TSDoc summary
E002require-paramerrorFunction parameter missing @param tag
E003require-returnserrorFunction missing @returns tag
E004require-exampleerrorExported symbol missing @example block
E005no-unresolved-linkerror{@link} target cannot be resolved
E006no-broken-paramerror@param tag references nonexistent parameter
E007no-duplicate-paramerrorDuplicate @param tag for the same parameter
E008require-throwserrorFunction throws without @throws tag
E009no-missing-typeerrorType annotation missing on exported symbol
E010require-package-docerrorPackage entry point missing @packageDocumentation
E011no-internal-exporterror@internal symbol is publicly exported
E012require-deprecation-noticeerrorDeprecated symbol missing @deprecated description
E013no-any-typeerrorExported symbol uses the `any` type
E014require-readonlyerrorPublic interface property should be readonly
E015no-empty-docerrorTSDoc comment is empty or whitespace-only
E016require-release-tagerrorExported symbol missing @public, @beta, or @internal tag
E017no-untagged-overrideerrorOverriding method missing @override tag
E018require-generic-docerrorGeneric type parameter missing @typeParam tag
E019no-floating-promiseerrorAsync function result not documented or handled
E020require-module-docerrorModule file missing file-level documentation
W001prefer-remarkswarnComplex symbol benefits from @remarks section
W002prefer-examplewarnPublic API symbol has no @example block
W003prefer-returns-typewarn@returns tag missing type annotation
W004prefer-param-typewarn@param tag missing type annotation
W005prefer-see-alsowarnSymbol references related items without @see
W006prefer-sincewarnNew public symbol missing @since tag
W007prefer-default-valuewarnOptional property missing @defaultValue tag
W008prefer-alpha-tagwarnUnstable API missing @alpha tag
W009prefer-short-summarywarnSummary line exceeds recommended length
W010prefer-verb-summarywarnSummary should begin with a verb
W011prefer-period-summarywarnSummary line should end with a period
W012prefer-capitalized-summarywarnSummary line should begin with a capital letter
W013prefer-no-thiswarnTSDoc should not use first-person pronouns
W014prefer-throws-typewarn@throws tag missing exception type
W015prefer-consistent-returnswarnReturn type inconsistent with @returns tag
W016prefer-no-htmlwarnTSDoc contains raw HTML instead of markdown
W017prefer-explicit-visibilitywarnExported symbol missing explicit visibility tag
W018prefer-description-lengthwarn@param description is too short to be useful
W019prefer-example-titlewarn@example block missing a descriptive title comment
W020prefer-no-magic-numberswarnNumeric literal in signature should have a named constant

SSG Targets

The gen.ssgTarget option controls which documentation platform the generated files target. Each platform receives platform-specific frontmatter and link formats.

TargetDescription
fumadocsNext.js-based doc site with full-text search and MDX support
docusaurusReact-based docs with versioning, i18n, and sidebar navigation
nextraNext.js docs theme with MDX, built-in search, and GitHub integration
vitepressVite + Vue-based static docs with deep Markdown customization
mintlifyHosted docs platform with OpenAPI integration and analytics

On this page