Skip to content

chore: scope docsite tsconfig types so ambient typings don't leak into Storybook props tables - #36607

Open
Dmytro Kirpa (dmytrokirpa) wants to merge 1 commit into
microsoft:masterfrom
dmytrokirpa:fix/docsite-tsconfig-docgen-types
Open

chore: scope docsite tsconfig types so ambient typings don't leak into Storybook props tables#36607
Dmytro Kirpa (dmytrokirpa) wants to merge 1 commit into
microsoft:masterfrom
dmytrokirpa:fix/docsite-tsconfig-docgen-types

Conversation

@dmytrokirpa

@dmytrokirpa Dmytro Kirpa (dmytrokirpa) commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Description

focusgroup and focusgroupstart were showing up in the props table of every component documented in public-docsite-v9 and public-docsite-v9-headless.

Root cause

react-docgen-typescript resolves ./tsconfig.json relative to the Storybook cwd — the docsite project root. Those are solution-style configs (include: [], files: []) that extend tsconfig.base.all.json and inherit:

"typeRoots": ["node_modules/@types", "./typings"]

Because they declared no types array, TypeScript auto-included every package folder under typeRoots — including typings/focusgroup, which does a global declare module 'react' augmentation adding focusgroup/focusgroupstart to HTMLAttributes. Storybook's default docgen propFilter only excludes props declared under node_modules, and this typing lives in the repo, so it passed straight through onto every component.

https://storybooks.fluentui.dev/react/?path=/docs/components-accordion--docs

Screenshot 2026-08-22 at 15 58 15

Fix

Declare the types the docsites actually need, mirroring what the library/stories tsconfigs already use:

"types": ["static-assets", "environment"]

This is a no-op for type-checking (the configs contain no files) and stops the ambient auto-inclusion that docgen was picking up.

Note: published .d.ts files were not affected — verified there is no /// <reference types=\"focusgroup\" /> in dist, since no public API references a symbol declared by that typing.

https://fluentuipr.z22.web.core.windows.net/pull/36607/public-docsite-v9/react/index.html?path=/docs/components-accordion--docs

image

Verification

  • Props tables no longer list focusgroup / focusgroupstart
  • Real props (including components that declare their own focusgroup prop) still render

…o Storybook props tables

react-docgen-typescript resolves the tsconfig.json at the Storybook cwd. These solution
configs had no 'types' array, so TypeScript auto-included every package under the
repo's typeRoots (including typings/focusgroup, which augments React's HTMLAttributes).
That surfaced 'focusgroup' and 'focusgroupstart' as props on every documented component.

Declare the types the docsites actually need, matching the library/stories tsconfigs.
@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) requested a review from a team as a code owner August 22, 2026 11:04
@github-actions

Copy link
Copy Markdown

📊 Bundle size report

✅ No changes found

@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant