Skip to content

Bug: [email protected] package contains outdated index.d.ts (v3.0 types) #274

@EmanuelAlderete

Description

@EmanuelAlderete

The type definition for transport options (TransportStreamOptions, used in FileTransportOptions, etc.) in the [email protected] package is missing the filter property.

Steps to Reproduce:

Install dependencies:
npm install winston winston-transport typescript
(Ensures [email protected] and [email protected]).

Use a Transport (like transports.File) and try to add the filter option:

import { createLogger, format, transports } from 'winston';
// ... other imports and logger configuration

new transports.File({
  // ... other options
  filter: (info) => info.level === 'info' // <-- Causes TypeScript error here
})

Expected Behavior:

No TypeScript errors. The filter property should be accepted in the Transport options.

Actual Behavior:

TypeScript compilation fails with an error similar to:
Object literal may only specify known properties, and 'filter' does not exist in type 'FileTransportOptions'.ts(2353)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions