Configuration

The qui-docs.config.ts file controls how QUI Docs discovers pages, builds navigation, and exports content.

File Discovery

The config file is loaded by the @qualcomm-ui/mdx-vite Vite plugin at build and dev time. The plugin locates it in one of two ways:

  • Auto-detection: when no configFile is passed, the plugin searches upward from process.cwd() until it finds a matching qui-docs.config.ts.
  • Explicit path: you can pass configFile directly in vite.config.ts, which loads the file at that exact path without searching.
// vite.config.ts
import mdx from "@mdx-js/rollup"
import {defineConfig} from "vite"

import {
  frontmatterHmrPlugin,
  getRehypePlugins,
  getRemarkPlugins,
  quiDocsPlugin,
  reactDemoPlugin,
} from "@qualcomm-ui/mdx-vite"

export default defineConfig({
  // ...

  plugins: [
    // ...
    mdx({
      providerImportSource: "@mdx-js/react",
      rehypePlugins: [...getRehypePlugins({configFile: quiDocsConfigFile})],
      remarkPlugins: [...getRemarkPlugins()],
    }),
    quiDocsPlugin(),
  ],
})

The standard config file shape:

// qui-docs.config.ts
import type {QuiDocsConfig} from "@qualcomm-ui/mdx-vite"

export default {
  appDirectory: "src",
  pageDirectory: "routes",
  navConfig: [{id: "_index", title: "Home"}],
} satisfies QuiDocsConfig

Route Discovery

appDirectory and pageDirectory

  • appDirectory: the root app directory name, relative to process.cwd(). Default: "src".
  • pageDirectory: the name of the pages directory, relative to appDirectory. Default: "routes".

Combined, pages live at <process.cwd()>/<appDirectory>/<pageDirectory>. With defaults, that is src/routes.

routingStrategy

Controls how file paths map to URL segments. This is explored in detail on the Routing Conventions page.

The navConfig array controls sidebar order, section groupings, initial expanded state, and per-route display properties. For how to define and nest navConfig entries, see Page Configuration. Define folder entries in _nav.json files to keep them with their routes. For the full option reference, see NavConfig.

Content and Validation

lint

Controls content validation rules. Each rule accepts a severity for development and build:

  • "off": disables the rule.
  • "warn": logs issues to the console.
  • "error": logs issues in development. Issues fail the production build (vite build).

Enable fileLinks with "warn" or "error" in qui-docs.config.ts:

lint: {
  brokenLinks: "warn",
  configs: "warn",
  fileLinks: "warn",
  pageTitle: "warn",
}

Rules:

  • brokenLinks: validates internal MDX links and fragment references after the page map and table of contents are built. Default: "warn".
  • configs: validates the QUI Docs config and _nav.json files. Default: "warn".
  • fileLinks: reports internal links to MDX pages that use URL paths instead of relative .mdx file paths. Default: "off".
  • pageTitle: validates the h1 page title of every MDX page. Default: "warn".

With fileLinks: "warn", the rule logs URL-path links to MDX pages as warnings during development and build. Run qui-docs fix-links to convert them to relative .mdx file links. Use --dry-run to preview the replacements. See Relative Links for file-link syntax.

  • Same-page links such as ./#size are reported with #size as the replacement.
  • Links to TSX pages, public directory files, and missing pages are skipped. The brokenLinks rule reports missing pages.

Issues are grouped by source page:

Found 2 links that should use a relative .mdx file path:

  /api/nav-config
    x /api/qui-docs-config#navConfig — use ./qui-docs-config.mdx#navConfig
    x ./#size — use #size

Run qui-docs fix-links to apply these replacements, or qui-docs fix-links --dry-run to preview them.

The pageTitle rule reports:

  • Content before the h1 title. The page must start with # {frontmatter.title} or a literal title such as # Page Title. Frontmatter, import, and export statements may appear before it. Text and JSX components may not.
  • Any additional h1 heading after the title. Use h2 or lower for sections.

Lines such as # comment inside fenced code blocks are not headings. Pages with no content, such as a page that only exports a loader, are skipped. Issues are reported as path/to/file.mdx:line:

Found 2 page title issues:

  /getting-started
    x src/routes/getting-started.mdx:5 — page must start with an h1 title, e.g. `# {frontmatter.title}`
    x src/routes/getting-started.mdx:20 — only the page title may be an h1, use h2 or lower

The configs rule reports:

  • Properties the config does not recognize, such as misspelled options. Nested objects and navConfig entries are checked.
  • Entries in navConfig and in _nav.json children whose id does not match a page or folder, such as a renamed or removed route. Entries nested under an unmatched entry are not reported separately.

A folder id matches if the folder contains pages. .tsx route files count as pages. Issues are grouped by file. Issues from the root navConfig are listed under the config file path:

Found 3 config issues:

  qui-docs.config.ts
    x lint: Unrecognized key: "pageTitel"
    x navConfig[1].id: "missing" doesn't match a page or folder (/missing)

  src/routes/docs+/_nav.json
    x children[1].id: "gone" doesn't match a page or folder (/docs/gone)

Config values that fail validation, such as lint: {pageTitle: "fatal"}, are not part of the configs rule. They always fail. The Vite plugin throws Failed to parse config file. followed by the config file path and the issues. Invalid _nav.json files are not part of the rule either. See _nav.json validation.

CLI Linting

qui-docs lint validates the config and _nav.json files, then runs enabled brokenLinks, fileLinks, and pageTitle rules against every MDX page without a Vite build. Config validation includes the configs rule. Use it in CI to fail on lint errors.

  • Every enabled rule reports errors by default, even if its configured or default severity is "warn".
  • Rules with a configured or default severity of "off" are skipped.

Rules added in later releases run in existing CI scripts without changes unless their configured or default severity is "off".

Run the command from the docs app root. appDirectory, typeDocProps, and public directory paths resolve from the current working directory.

qui-docs lint

The command logs issues in the same format as the Vite plugin. It lists skipped rules before the summary. With the default config:

Skipped 1 rule:
  fileLinks (disabled by default)
Checked qui-docs.config.ts, 1 _nav.json file, and 20 pages: 0 errors, 0 warnings.

The summary lists the config file name, the number of _nav.json files, and the number of MDX pages.

Config values that fail validation stop the command before pages are checked. They are listed under the config file path:

Found 1 invalid config value:

  qui-docs.config.ts
    x lint.pageTitle: Invalid input

Rules set to "off" in the config are labeled (disabled from config file). Rules omitted from the config with a default of "off" are labeled (disabled by default). Rules disabled by a per-rule option are labeled (disabled from command flag).

  • Exit code 1: any errors, or a configuration/load failure.
  • Exit code 0: no errors. Warnings do not fail the command.

headings

Controls which heading depths are included in the in-page table of contents and the search index. Default: ['h2', 'h3', 'h4'].

typeDocProps

Relative path to the generated doc-props.json file. Required for the <TypeDocProps /> component to render property documentation in MDX pages. See TypeDoc for the full setup. Ignore if you aren't using the <TypeDocProps /> component.

Page Metadata

pageTimestampMetadata controls whether per-page timestamp data is extracted from git history:

  • "off" (default): no timestamp data.
  • "timestamp": populates updatedOn from the last git commit touching the file.
  • "user-and-timestamp": populates both updatedOn and updatedBy.

This data is surfaced on each page (typically in the page footer) and can be included in knowledge exports. Git history must be available at build time, and it's best to do a full repository checkout for accurate dates and timestamps.

Knowledge Export

The knowledge field enables AI knowledge export to pages.json and sections.json. These files support LLM consumption, RAG pipelines, and semantic search. See AI Knowledge for configuration, including baseUrl, exclude globs, and extraFiles.

Full Reference

The QuiDocsConfig API reference lists all configuration options, including advanced build knobs (disableCache, throwOnError, hotUpdateIgnore) and typeDocPropsOptions.

Updated by Ryan Bower