Skip to content

Documentation for /// <reference types="..." /> is outdated/incorrect #3261

@jfirebaugh

Description

@jfirebaugh

Page URL: https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-types-

Issue:

The page states:

For declaration files generated during compilation, the compiler will automatically add /// <reference types="..." /> for you; A /// <reference types="..." /> in a generated declaration file is added if and only if the resulting file uses any declarations from the referenced package.

This is no longer correct as of TypeScript 5.5; see https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/#simplified-reference-directive-declaration-emit.

The documentation should be updated with the new behavior, including coverage of preserve="true".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions