eslint 8.57 WIP:

* tweaking some more rules.
* fixing linting.
This commit is contained in:
John Livingston
2024-09-09 20:01:25 +02:00
parent c010758164
commit fd27105c2c
34 changed files with 165 additions and 36 deletions

View File

@ -21,7 +21,13 @@ export const slowModePlugin = {
return
}
const slowModeDuration = parseInt(chatbox?.config?.get('slow_mode_duration'))
const slowModeDurationRaw = chatbox?.config?.get('slow_mode_duration') ?? NaN
const slowModeDuration =
typeof slowModeDurationRaw === 'string'
? parseInt(slowModeDurationRaw)
: typeof slowModeDurationRaw === 'number'
? Math.trunc(slowModeDurationRaw)
: NaN
if (!(slowModeDuration > 0)) { // undefined, NaN, ... are not considered > 0.
return
}