the tswhy logo: a question mark in a box

tswhy‽

A community effort to enrich TypeScript diagnostics.

Editing TS1084:

All diagnostics and fixes are authored in markdown. Propose any changes by editing the markdown. Additional fixes can be added. A preview of the rendered diagnostic will update when changes are made.

Once all proposed changes are made, the Propose button will submit the information and confirm raising the PR.

TS1084

Invalid 'reference' directive syntax.

When using triple slash references, the tag must contain a path, types, lib, or no-default-lib key. If the tag does not include any of these keys, this error will be reported:

/// <reference />

Fix: Use a valid reference directive.

To fix the error, complete the tag by adding a valid key:

/// <reference path="./some-file" />
/// <reference types="node" />
/// <reference lib="es2015" />
/// <reference no-default-lib="true"/>

Also see Triple-Slash Directives in the TypeScript Handbook.