guardian/dotcom-rendering

Remove `index.d.ts`

Open

#7,638 opened on Apr 26, 2023

 (3 comments) (1 reaction) (1 assignee)TypeScript (35 forks)auto 404
Pick me upTeam Candidate: WebXgood first issue

Repository metrics

Stars
 (271 stars)
PR merge metrics
 (PR metrics pending)

Description

Why?

Declaration files create ambient types, which appear in a global namespace across the project. We think it's preferable to avoid adding types to a global scope, and instead prefer to import them as needed.

How?

Migrate the types in the index.d.ts1 file into normal .ts files, and import them as needed:

Footnotes

  1. https://github.com/guardian/dotcom-rendering/blob/4ea272b55efa01ba88f0f5ff60f6bc9d14198147/dotcom-rendering/index.d.ts

Contributor guide