Skip to content

Typo in LoggerConfig type — desination should be destination #73

@jbsn94

Description

@jbsn94

Package version

7.1.0

Describe the bug

Bug: Typo in LoggerConfig type — desination should be destination

Package

@adonisjs/logger@7.1.0

Description

The LoggerConfig type has a typo in the property name: desination (missing the letter t) instead of destination.

This affects both the type definition and the runtime implementation, so the typo is "consistent" and the feature works — but it forces consumers to use the misspelled property name, which is confusing and contradicts the official documentation.

Affected locations

Type definitionsrc/types.ts

export type LoggerConfig = Omit<LoggerOptions<any>, 'browser' | 'timestamp'> & {
    enabled?: boolean;
    desination?: DestinationStream;  // ← should be "destination"
    timestamp?: TimestampKeywords | boolean | (() => string);
};

Implementationsrc/logger.ts

const { desination, transport: configTransport, timestamp, ...rest } = options;
const pinoOptions = desination ? Object.assign({}, rest) : Object.assign({ transport: configTransport }, rest);
return desination ? pino(pinoOptions, desination) : pino(pinoOptions);

JSDoc commentssrc/logger.ts (a slightly different variant: desintation)

* - destination: A stream to pass to pino as the desintation stream.
* const logger = new Logger({ enabled: true, desintation: pino.destination(2) })

Test factoryfactories/main.ts

if (this.#logsCollection) this.#options.desination = getFakeStream(...)

Reproduction

import { defineConfig } from '@adonisjs/core/logger'

const config = defineConfig({
  default: 'app',
  loggers: {
    app: {
      enabled: true,
      level: 'info',
      desination: myCustomStream,  // compiles (typo)
      destination: myCustomStream, // type error (correct spelling)
    },
  },
})

Additional context

  • The correct spelling destination is already used in FileTargetOptions and PrettyTargetOptions within the same types.ts file.
  • The documentation references destination with the correct spelling.

Impact

Low severity — the feature works since both the type and implementation use the same misspelled name. However, it causes confusion when following the docs, and IDE autocomplete shows the misspelled property.

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