guardian/dotcom-rendering

Remove `index.d.ts`

開放

#7,638 建立於 2023年4月26日

 (3 則留言) (1 個反應) (1 位負責人)TypeScript (35 個分叉)auto 404
Pick me upTeam Candidate: WebXgood first issue

倉庫指標

星標
 (271 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南