Skip to content

WriteFileCallback: sourceFiles is optional #15007

Closed
@ivogabe

Description

@ivogabe

WriteFileCallback is defined as follows:

export interface WriteFileCallback {
    (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: SourceFile[]): void;
}

I was wondering why sourceFiles marked as optional. As of version 3.6, we're using this in gulp-typescript. This works fine, but ivogabe/gulp-typescript#499 describes that sourceFiles is undefined in some special case. So, when is sourceFiles undefined, and is there some way to force it being set?

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIRelates to the public API for TypeScriptBugA bug in TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions