You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@wbt removed types in the following commit: c3c3911
I now get typescript and eslint errors when using the logger with syslog levels
What version of Winston presents the issue?
v3.12.0
What version of Node are you using?
v18.19.0
If this worked in a previous version of Winston, which was it?
3.11.0
Minimum Working Example
constlogger=createLogger({levels: config.syslog.levels,transports: [newtransports.Console()]})logger.alert('my alert message')// ^Unsafe call of an `any` typed value.eslint[@typescript-eslint/no-unsafe-call](https://typescript-eslint.io/rules/no-unsafe-call)// ^Property 'alert' does not exist on type 'Logger'.ts(2339)
Additional information
You can either:
put them back or mark them (along with every LeveledLogMethod) as optional.
try and work some typescript magic to detect what methods to include depending on the config value of levels. maybe something like making the logger type generic with a <levels extends Config.AbstractConfigSetLevels> and a [level: keyof levels]: LeveledLogMethod (I didn't try this, but intuitively it should work)
The text was updated successfully, but these errors were encountered:
🔎 Search Terms
types, alert
The problem
@wbt removed types in the following commit: c3c3911
I now get typescript and eslint errors when using the logger with syslog levels
What version of Winston presents the issue?
v3.12.0
What version of Node are you using?
v18.19.0
If this worked in a previous version of Winston, which was it?
3.11.0
Minimum Working Example
Additional information
You can either:
LeveledLogMethod
) as optional.<levels extends Config.AbstractConfigSetLevels>
and a[level: keyof levels]: LeveledLogMethod
(I didn't try this, but intuitively it should work)The text was updated successfully, but these errors were encountered: