Skip to content

Introducing type checking to an existing project

Marc Jakobi edited this page Nov 15, 2023 · 1 revision

Introducing type checking to an existing project can be tedious, if the project has a lot of code that does not type check. Especially if there exist a lot of open PRs that could become conflicted due to type check fixes.

Here are some suggested steps (by @Amrock to make the migration easier:

  • Put any code that does not type check in a global ignore file (e.g. using the workspace.ignoreDir setting. Or, alternatively, add ---@diagnostic disable to the top of each file.
  • Fix and unignore modules/files one by one.

This way has almost no friction for finishing and merging existing PRs.

Note

If some friction is okay: the first step shouldn't put files into an ignore list if they're green initially.

Clone this wiki locally