babel / gulp-babel

Gulp plugin for Babel
https://babeljs.io
MIT License
1.32k stars 120 forks source link

@types/gulp-babel contains wrong type for presets #206

Closed cowwoc closed 3 years ago

cowwoc commented 4 years ago

gulp-babel: 8.0.0 @types/gulp-babel: 6.1.29

The typescript definition file contains:

declare function babel(options?: {
    filename?: string,
    filenameRelative?: string,
    presets?: string[],
    plugins?: string[],
    highlightCode?: boolean,
    only?: string | string[],
    ignore?: string | string[],
    auxiliaryCommentBefore?: any,
    auxiliaryCommentAfter?: any,
    sourceMaps?: any,
    inputSourceMap?: any,
    sourceMapTarget?: any,
    sourceFileName?: any,
    sourceRoot?: any,
    moduleRoot?: any,
    moduleIds?: any,
    moduleId?: any,
    getModuleId?: any,
    resolveModuleSource?: any,
    keepModuleIdExtesions?: boolean,
    code?: boolean,
    ast?: boolean,
    compact?: any,
    comments?: boolean,
    shouldPrintComment?: any,
    env?: any,
    retainLines?: boolean
}): NodeJS.ReadWriteStream;

Notice that presets is expected to be a string[] but according to https://babeljs.io/docs/en/options they should be a PresetEntry[] where PresetEntry is a EntryTarget | [EntryTarget, EntryOptions] | [EntryTarget, EntryOptions, string] | ConfigItem.

nicolo-ribaudo commented 3 years ago

This should be reported to https://github.com/DefinitelyTyped/DefinitelyTyped, the TS types are not maintained in this repository.