Skip to content

tsconfig.json "lib": "dom" should include "dom.iterable"(?)Β #60959

Open
@rauschma

Description

@rauschma

πŸ”Ž Search Terms

lib, dom, dom.iterable

πŸ•— Version & Regression Information

  • An issue as of TypeScript 5.7.2

⏯ Playground Link

No response

πŸ’» Code

// Does TypeScript have the types for DOM iteration?
for (const x of document.querySelectorAll('div')) {}

πŸ™ Actual behavior

  • No error if "lib" is omitted from tsconfig.json.
  • Error if "lib" is ["es2024", "DOM"]
  • No error if "lib" is ["es2024", "DOM", "DOM.iterable"]

πŸ™‚ Expected behavior

Given how broadly supported DOM.iterable is, it should be part of DOM by now(?)

Interestingly, es2024.full looks like this but can’t be used as a value of "lib":

/// <reference lib="es2024" />
/// <reference lib="dom" />
/// <reference lib="webworker.importscripts" />
/// <reference lib="scripthost" />
/// <reference lib="dom.iterable" />
/// <reference lib="dom.asynciterable" />

Additional information about the issue

No response

Metadata

Metadata

Assignees

Labels

Needs InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions