Skip to content

core(config): import LH types in exported configs#16979

Open
lawrence3699 wants to merge 1 commit intoGoogleChrome:mainfrom
lawrence3699:fix/config-type-imports
Open

core(config): import LH types in exported configs#16979
lawrence3699 wants to merge 1 commit intoGoogleChrome:mainfrom
lawrence3699:fix/config-type-imports

Conversation

@lawrence3699
Copy link
Copy Markdown

Summary

  • fixes the generated declaration files for exported configs that currently emit LH.Config without importing ../../types/lh.js
  • reproduces lr-mobile-config.d.ts breaks TS builds: Cannot find namespace 'LH' #16503 and the same missing-import problem on the other exported config entry points in core/config/
  • aligns these config modules with the existing pattern already used by configs like default-config.js and desktop-config.js

Related Issues/PRs

Failing scenario before this change:

  • a strict TypeScript project importing lighthouse/core/config/lr-mobile-config.js failed with TS2503: Cannot find namespace 'LH'
  • the generated .d.ts for the affected config exports declared LH.Config without importing ../../types/lh.js

After this change:

  • the emitted declarations import ../../types/lh.js, so those config entry points type-check correctly for external consumers

Validation:

  • yarn type-check
  • strict external consumer tsc against the built repo tree importing the affected core/config/*.js entry points
  • yarn build-pack
  • strict external consumer tsc against the packed dist/lighthouse.tgz importing lighthouse/core/config/lr-mobile-config.js, lighthouse/core/config/lr-desktop-config.js, and lighthouse/core/config/perf-config.js

@lawrence3699 lawrence3699 requested a review from a team as a code owner April 22, 2026 02:22
@lawrence3699 lawrence3699 requested review from paulirish and removed request for a team April 22, 2026 02:22
@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 22, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@paulirish
Copy link
Copy Markdown
Member

Nice. seems good.

can you sign the CLA?

@paulirish
Copy link
Copy Markdown
Member

Nice. seems good.

can you sign the CLA?

@lawrence3699 plz :)

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.

lr-mobile-config.d.ts breaks TS builds: Cannot find namespace 'LH'

2 participants