-
-
Notifications
You must be signed in to change notification settings - Fork 10
Description
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 definition — src/types.ts
export type LoggerConfig = Omit<LoggerOptions<any>, 'browser' | 'timestamp'> & {
enabled?: boolean;
desination?: DestinationStream; // ← should be "destination"
timestamp?: TimestampKeywords | boolean | (() => string);
};Implementation — src/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 comments — src/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 factory — factories/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
destinationis already used inFileTargetOptionsandPrettyTargetOptionswithin the sametypes.tsfile. - The documentation references
destinationwith 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.