Skip to main content

Configuration File

mint-tsdocs uses cosmiconfig to load configuration. It searches for configuration in the following locations (in order):
  1. mint-tsdocs.config.json (recommended)
  2. .mint-tsdocsrc
  3. .mint-tsdocsrc.json
  4. mintlifyTsdocs field in package.json

JSON Schema

Add the $schema field for IDE autocomplete and validation:

Core Options

entryPoint

Type: string (required) Path to the main TypeScript declaration file (.d.ts) that serves as the entry point for your API.
Auto-detection:
  • Checks types field in package.json
  • Checks typings field in package.json
  • Searches common paths: ./lib/index.d.ts, ./dist/index.d.ts, ./build/index.d.ts
Notes:
  • Must point to a compiled .d.ts file (not .ts source)
  • Run TypeScript compiler before generating docs
  • Path is relative to project root

outputFolder

Type: string Default: ./docs/reference Directory where generated MDX documentation files will be written.
Notes:
  • Directory will be created if it doesn’t exist
  • Existing files will be overwritten
  • Path is relative to project root

docsJson

Type: string Default: Auto-detected or ./docs/docs.json Path to Mintlify’s docs.json navigation file.
Auto-detection searches:
  • ./docs/docs.json
  • ./docs.json
  • ./documentation/docs.json
Notes:
  • Navigation entries will be automatically added to this file
  • File must exist and be valid JSON
  • Set to false to skip navigation updates

tabName

Type: string Default: "API Reference" Name of the tab in Mintlify navigation where API docs will appear.
Example in docs.json:

groupName

Type: string Default: "API" Name of the group within the tab where API items will be organized.
Example in docs.json:

README Options

convertReadme

Type: boolean Default: false Whether to convert the project’s README.md to MDX and include it in the documentation.
Notes:
  • Searches for README.md in project root
  • Converts markdown to Mintlify-compatible MDX
  • Adds to navigation with specified title

readmeTitle

Type: string Default: "README" Title for the converted README page in navigation (only used if convertReadme: true).

Template Options

templates

Type: object Configuration for Liquid template customization.

templates.userTemplateDir

Type: string Path to directory containing custom Liquid templates.
Template files:
  • layout.liquid - Base layout wrapper
  • class.liquid - Class documentation
  • interface.liquid - Interface documentation
  • method.liquid - Method documentation
  • property.liquid - Property documentation
  • constructor.liquid - Constructor documentation
  • function.liquid - Function documentation
  • enum.liquid - Enum documentation
  • type-alias.liquid - Type alias documentation
  • namespace.liquid - Namespace documentation
Generate templates:

templates.cache

Type: boolean Default: true Whether to cache compiled templates for better performance.
Notes:
  • Recommended: true for production, false for template development
  • Clear cache by deleting node_modules/.cache/mint-tsdocs/

templates.strict

Type: boolean Default: true Whether to enable strict mode in Liquid template engine.
Strict mode:
  • Throws errors on undefined variables
  • Throws errors on invalid filters
  • Helps catch template bugs during development
Lenient mode (strict: false):
  • Silently ignores undefined variables
  • Silently ignores invalid filters
  • May hide template errors

Lint Options

lint

Type: object Configuration for the lint command.

lint.eslint.enabled

Type: boolean Default: Not set (auto-detect) Controls ESLint integration with eslint-plugin-tsdoc:
  • true - Force enable. Shows an error with install command if eslint is not installed.
  • false - Force disable. No ESLint analysis, no hints.
  • Not set - Auto-detect. Runs ESLint if installed, shows a hint with install instructions if not.
Required packages (when enabled):

lint.eslint.directories

Type: string[] Default: ["src"] Directories to lint. ESLint discovers TypeScript files automatically within these directories.

lint.eslint.configPath

Type: string Default: Auto-discovered Path to custom ESLint configuration file. If not set, ESLint auto-discovers eslint.config.js and other standard config files.

lint.failOnError

Type: boolean Default: true Whether the lint command should exit with code 1 when errors are found. Set to false to treat errors as non-blocking.

Message Reporting Options

apiExtractor.messages

Type: object Configuration for controlling how different types of diagnostic messages are reported during API extraction.

messages.compilerMessageReporting

Type: Record<string, MessageReportingItem> Configuration for TypeScript compiler diagnostic messages.
Message IDs:
  • TypeScript error codes (e.g., TS2551, TS2322)
  • Use default to set default behavior for all messages

messages.extractorMessageReporting

Type: Record<string, MessageReportingItem> Configuration for API Extractor diagnostic messages.
Common message IDs:
  • ae-missing-release-tag - Missing @public, @beta, @alpha, or @internal tag
  • ae-undocumented - Missing documentation comment
  • ae-forgotten-export - Exported type references unexported declaration

messages.tsdocMessageReporting

Type: Record<string, MessageReportingItem> Configuration for TSDoc parser diagnostic messages.
Common message IDs:
  • tsdoc-param-tag-missing-hyphen - @param tag missing hyphen
  • tsdoc-undefined-tag - Unrecognized TSDoc tag
  • tsdoc-param-tag-with-invalid-name - Invalid parameter name in @param

MessageReportingItem

Configuration for how a specific message should be reported. Properties:

logLevel

Type: 'error' | 'warning' | 'none' How to report this message type:
  • error - Report as an error (fails the build)
  • warning - Report as a warning (doesn’t fail the build)
  • none - Suppress the message entirely

addToApiReportFile

Type: boolean Default: false Whether to include this message in the API report file (.api.md). Example:

API Extractor Options

apiExtractor

Type: object Configuration for API Extractor integration.

apiExtractor.configPath

Type: string Default: Auto-generated in .tsdocs/api-extractor.json Path to custom API Extractor configuration file.
Notes:
  • If specified, mint-tsdocs will use your custom config
  • If not specified, config is auto-generated from other settings
  • Custom config gives you full control over API Extractor

apiExtractor.bundledPackages

Type: string[] Default: [] List of package names to treat as bundled (include their declarations in the documentation).
Use case:
  • Document internal packages alongside main package
  • Include types from dependencies in your documentation

apiExtractor.compiler

Type: object TypeScript compiler configuration for API Extractor.
compiler.tsconfigFilePath
Type: string Default: Auto-detected Path to tsconfig.json file.
Auto-detection searches:
  • ./tsconfig.json
  • ./tsconfig.build.json
  • ./tsconfig.prod.json

compiler.skipLibCheck
Type: boolean Default: true Whether to skip type checking of declaration files.
Recommended: true for faster builds

apiExtractor.docModel

Type: object Configuration for API Extractor’s documentation model output.
docModel.enabled
Type: boolean Default: true Whether to generate .api.json files.
Note: Must be true for mint-tsdocs to work
docModel.projectFolderUrl
Type: string Base URL for source code links in generated documentation.
Example link:

apiExtractor.apiReport

Type: object Configuration for API report file generation (optional). API reports show a text summary of your public API surface and can be committed to track API changes over time.
apiReport.enabled
Type: boolean Default: false Whether to generate API report files (.api.md).

apiReport.reportFileName
Type: string Default: "<unscopedPackageName>.api.md" Name pattern for the API report file.
Supported tokens:
  • <unscopedPackageName> - Package name without @scope/
  • <packageName> - Full package name

apiReport.reportFolder
Type: string Default: "<projectFolder>/temp/" Folder where the API report file will be written.
Supported tokens:
  • <projectFolder> - Project root directory

apiReport.reportTempFolder
Type: string Default: "<projectFolder>/temp/" Temporary folder used during API report generation.
Note: This folder is used for intermediate files during generation.

apiExtractor.dtsRollup

Type: object Configuration for .d.ts rollup generation (optional). Rollups combine multiple .d.ts files into a single file, optionally trimmed by release level.
dtsRollup.enabled
Type: boolean Default: false Whether to generate rolled-up .d.ts declaration files.

dtsRollup.publicTrimmedFilePath
Type: string Path for the public-trimmed .d.ts rollup file. Includes only declarations marked with @public.
Supported tokens:
  • <unscopedPackageName> - Package name without @scope/
  • <packageName> - Full package name
  • <projectFolder> - Project root directory
Use case: Ship this file as your package’s main type definitions
dtsRollup.betaTrimmedFilePath
Type: string Path for the beta-trimmed .d.ts rollup file. Includes declarations marked with @public and @beta.
Use case: Provide early access to beta APIs for testing
dtsRollup.alphaTrimmedFilePath
Type: string Path for the alpha-trimmed .d.ts rollup file. Includes declarations marked with @public, @beta, and @alpha.
Use case: Provide experimental APIs for early adopters
dtsRollup.untrimmedFilePath
Type: string Path for the untrimmed .d.ts rollup file. Includes all declarations regardless of release level (including @internal).
Use case: Internal testing or monorepo development

Complete Example


Validation

mint-tsdocs validates your configuration on startup. Common validation errors:

Environment-Specific Configs

Use different configs for different environments: Development:
Production:
package.json scripts:

Migration from api-documenter

If migrating from @microsoft/api-documenter:
  1. Keep your api-extractor.json:
  2. Or let mint-tsdocs generate it:

See Also