microsoft / microsoft/DefinitelyTyped-tools

How can library authors test types against multiple TS versions?

Open
#440 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
423
Forks
237
Avg merge
18h 18m
Merged PRs (30d)
11

Description

Hello, Emotion contributor here. 👋 We have been using dtslint to check our (rather complex) TypeScript definitions against multiple versions of TypeScript.

The problem is that the dtslint README indicates that dtslint has moved into DefinitelyTyped-tools, and DefinitelyTyped-tools is not intended for public consumption.

How are library authors supposed to test their types against multiple TypeScript versions? (When the types are in the library's repository rather than DefinitelyTyped.)

Here are some options I have considered, though none of them seem particularly good:

  1. Library authors use @definitelytyped/dtslint, even though it is not intended for public consumption.
  2. Someone forks dtslint and starts maintaining it again.
  3. Someone creates a new tool that enables testing against multiple TypeScript versions.
  4. Each library that needs to test on multiple TS versions writes a script that "manually" installs different TS versions from npm.
  5. Library authors give up on testing against multiple TS versions and instead test against a specific version or tag, e.g. the latest supported TS version (3.9 currently), typescript@latest, or typescript@next.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the dtslint README and the references to DefinitelyTyped-tools and @definitelytyped/dtslint in the issue. Compare the listed approaches for testing library types across TypeScript versions, then define a supported approach for libraries outside DefinitelyTyped. Done should include a documented, maintainable way to run those multi-version type checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.