Skip to content
Loopfunder
All projects
Proposed

TypeScript type definitions for untyped npm packages

Checked .d.ts type declarations and compile-time type tests for open-source JavaScript libraries that still lack types.

Ask us to open it

Code editor showing TypeScript syntax highlighting and inline type information.
An example: editor feedback in Visual Studio Code, the developer experience enabled by accurate .d.ts files. Wikimedia Commons contributor · CC BY-SA 4.0

Many small, widely used legacy JavaScript packages on npm still ship without TypeScript type declarations, forcing developers to fall back on untyped imports. Contributors write clean declaration files and compile-time type tests against pinned MIT or Apache packages. A static checker verifies types, exports, and packaging without executing runtime JavaScript.

How one piece works

  1. Pick an untyped library

    Select a pinned MIT or Apache JavaScript package tarball from the backlog and read its public exports.

  2. Write declarations and tests

    Author index.d.ts definitions and tests.ts compile-time assertions without using loose 'any' shortcuts.

  3. Static compiler checks it

    A locked container runs tsc, dtslint, module-resolution checks, and an export-surface diff with zero runtime JS execution.

What you would make

One index.d.ts declaration file plus one tests.ts compile-time test file (under 32 KB total) for one pinned untyped npm package, taking 20 to 50 minutes.

What it becomes

An MIT-licensed tracker and archive of roughly 3,000 newly typed JavaScript libraries ready for opt-in upstream submission.

Why it is worth doing

  • Static type checking verifies declarations without running untrusted contributor JavaScript code.
  • DefinitelyTyped proved long-term developer demand with 51,492 GitHub stars, 30,280 forks, and 91,997 commits.
  • Pairing tsc with Are The Types Wrong catches subtle CommonJS and ESM module-resolution bugs automatically.
  • An empirical study of 633 TypeScript bug reports confirmed that declaration and toolchain mismatches drive real faults.

How a piece is checked

A network-disabled container runs tsc --noEmit, dtslint, and Are The Types Wrong under a 30-second cap, limits 'any' escape hatches, and confirms every exported symbol from the JavaScript package is declared.

Before this can open

Needs a hardened static tsc and dtslint checking container, a JavaScript export-surface diff script, and a curated backlog of active untyped packages.

Read more

Ask us to open it

Tell us why you would like this project to open.