Closed
Description
π Search Terms
triple-slash reference added
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
π» Code
// @declaration: true
// @filename: /a/node_modules/extra/index.d.ts
interface Error2 {
stack2: string;
}
// @filename: /a/node_modules/something/index.d.ts
/// <reference types="extra" />
// ^ remove above and it will no directive will be added to app.d.ts
export function foo():Error2;
// @filename: /a/app.ts
// reference to extra will be added here if there exists another reference to extra
export function foo() {
return null! as Error2;
}
π Actual behavior
/// <reference types="extra" />
is added to app.d.ts
only if another reference directive to extra already exists (in this example one from node_modules
)
π Expected behavior
/// <reference types="extra" />
is always added since extra
is required for app.d.ts
to be valid
Additional information about the issue
This was discovered while trying to understand reference directives in the context of isolated declarations.