-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
π Search Terms
tripleslash directive modules reference
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
π» Code
// @module: Node16
// @moduleResolution: Node16
// @declaration: true
/// <reference types="node" />
import {URL} from 'node:url';
import {EventEmitter} from 'node:events';
import {Buffer} from 'node:buffer';
export const stuff: [URL?, EventEmitter?, Buffer?] = [new URL('https://www.typescriptlang.org/play')]
π Actual behavior
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node/url.js" />
/// <reference types="node/ts4.8/url.js" />
/// <reference types="node/events.js" />
/// <reference types="node/ts4.8/events.js" />
/// <reference types="node/buffer.js" />
/// <reference types="node/ts4.8/buffer.js" />
import { URL } from 'node:url';
import { EventEmitter } from 'node:events';
import { Buffer } from 'node:buffer';
export declare const stuff: [URL?, EventEmitter?, Buffer?];
π Expected behavior
I'd expect only a single /// <reference types="node" resolution-mode="require"/>
to be emitted.
Additional information about the issue
Note that types acquisition and switching between ESM/CJS modes is a little bit unreliable in the TS playground so you might have to "touch" the repro to "refresh" the DTS output
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this