Guide · Ecosystem · 21 October 2026 · 5 min read

Who checks JavaScript with JSDoc instead of writing TypeScript

Svelte, SvelteKit, webpack, the unified collective, Lighthouse, Prettier and htmx check .js files with tsc: the evidence in each repository and their reasons.

  • Examples checked with TypeScript 5.9

Some of the most used JavaScript projects are written in .js files, typed with JSDoc and checked by tsc, and they publish types like any TypeScript package. This page lists the ones we could confirm from their own repositories on 21 October 2026, with the files that show it and the reason each project gave in its own words, linked. It is a factual record, not an endorsement: each project made its choice for its own reasons, and the comparison of JSDoc and TypeScript files sets out the trade-off in general.

The test for being on the list: the repository has a tsconfig.json or jsconfig.json with checkJs on that covers the source, and a script that runs tsc over it. Hand-written .d.ts files next to unchecked JavaScript are a different approach (and a perfectly good one), so they do not count here.

ProjectWhat tsc checksHow the published types are madeSince
Sveltepackages/svelte source, strict on.d.ts bundled from the JSDoc with dts-buddySvelte 4 (2023)
SvelteKitpackages/kit source.d.ts bundled with dts-buddy before publishing2021
webpacklib/**/*.js, strict ontypes.d.ts, written by a script from the JSDoc2018
unified collective (remark, micromark, mdast utilities)each package’s source, strict ontsc writes .d.ts files (emitDeclarationOnly)2021
Lighthousecore/**/*.js and more, strict ontsc-written .d.ts files copied into the package2017
Prettiermost of the source, noImplicitAny and strictNullChecks offhand-written .d.ts files2019
htmxsrc/htmx.js, from the command linetsc --emitDeclarationOnlyhtmx 2 (2024)

Svelte

Svelte’s compiler and runtime live in packages/svelte/src, almost entirely .js files with JSDoc. The package’s tsconfig.json turns on allowJs, checkJs and strict, and the check script runs tsc over it. The published types/index.d.ts is bundled from the JSDoc and a few hand-written .d.ts files by dts-buddy.

The move from TypeScript to JSDoc came with Svelte 4: the conversion (pull request 8569) went into the version 4 branch, which was merged in June 2023. Rich Harris explained the reasoning when the change drew attention: working without a build step is, in his words, “drastically nicer than dealing with build steps”, and users still get full types (his comment on Hacker News). In the pull request, a maintainer adds that debugging the compiler without a build step is simpler.

SvelteKit

SvelteKit’s packages/kit/tsconfig.json sets allowJs and checkJs, and its check script runs the checker; on the day we looked it ran TypeScript 7 (the native port) for it. The types are bundled with dts-buddy in prepublishOnly.

SvelteKit removed its TypeScript source in 2020 (pull request 178) and adopted JSDoc types with checkJs in March 2021. Rich Harris gave the reason in the issue that proposed it: he preferred types without a build step, having used JSDoc types elsewhere.

webpack

webpack’s tsconfig.json turns on allowJs, checkJs and strict for lib/**/*.js, and the lint:types script runs tsc (through a small wrapper for incremental runs) as part of yarn lint, which runs before the tests. The types.d.ts file in the package is written from the JSDoc by a script in the repository’s tooling folder. The contributing guide asks for CommonJS and JSDoc.

Type checking arrived in April 2018 (pull request 6862), when the code was untyped JavaScript. We found no statement of why webpack chose JSDoc over .ts files; in that pull request, a maintainer describes wanting to try TypeScript as a linter.

The unified collective

The packages behind remark and micromark, many small packages maintained by the same group, are JavaScript with JSDoc. Each package we checked (remark, micromark, mdast-util-to-markdown) has checkJs, strict, declaration and emitDeclarationOnly in its tsconfig.json, and a build script that runs tsc and a type-coverage check; the tests run the build. tsc writes the published .d.ts files, which are not committed.

The collective decided this in an RFC, Generate TypeScript typings from JSDoc (accepted in August 2021): the goal was to stop hand-written typings drifting from the code, while keeping the source JavaScript that can be installed straight from git, without a rewrite in TypeScript.

Lighthouse

Chrome’s Lighthouse turns on allowJs, checkJs and strict in tsconfig-base.json, its type-check script runs tsc --build over the project, and the tests run it. Its prepack step copies the .d.ts files tsc writes into the package.

Lighthouse removed the TypeScript from its command-line tool in November 2017 (pull request 3747). In that discussion, a maintainer explains the choice as keeping the code as it is, rather than rewriting it only to satisfy the tooling.

Prettier, partly

Prettier’s tsconfig.json turns on allowJs and checkJs, and its lint:typecheck script runs tsc. The check is deliberately partial: noImplicitAny and strictNullChecks are off, and about twenty source files are excluded. The published types are hand-written. JSDoc checking started in November 2019 (pull request 6770); in the issue that asks whether to convert Prettier to TypeScript, which is still open, a collaborator names being able to install Prettier directly from GitHub as one reason to keep the source JavaScript (issue 6286).

htmx

htmx 2 checks its source from the command line rather than a config: the types-check script runs tsc with --noEmit --checkJs on src/htmx.js, the tests run it, and a types-generate script writes the published .d.ts with --emitDeclarationOnly. That arrived in February 2024 (pull request 2336). We found no statement from the project itself on why.

Close, but not on the list

  • Preact has JSDoc comments and a jsconfig.json with checkJs for editors, but the config its lint script runs sets checkJs to false, and its published types are hand-written .d.ts files.
  • ESLint’s main repository publishes hand-written types and checks those, not its JavaScript. Some packages from its newer eslint/rewrite repository do check JavaScript with JSDoc.
  • undici and Fastify ship hand-written .d.ts files and test those.
  • Turbo (Hotwire) went the other way in 2023: it removed TypeScript and did not add JSDoc checking (pull request 971).

If a project you know checks its JavaScript this way and is missing, write to us with a link to its config; we add projects only after checking the repository ourselves.

Questions

Is this list an endorsement?

No. It records which well-known projects check their JavaScript with TypeScript's checker today, with the evidence from each repository and the reason each project gave. It says nothing about whether their choice suits your project.

Why are Preact and ESLint not on the list?

Both have JSDoc and type definitions, but on 21 October 2026 neither ran tsc over its JavaScript source with checkJs: their published types are hand-written .d.ts files, and their type checks cover those files. That is a different approach, and a common one.

How was each project checked?

In its repository on GitHub, on 21 October 2026: a tsconfig.json or jsconfig.json with checkJs on and covering the source, a script in package.json that runs tsc over it, and how the package's .d.ts files are made.

Sources

Last reviewed 21 October 2026.