eslint-plugin

@masknet/prefer-timer-id

Enforce best practice with timer function

Rule Details

Require store timer id on clear / cancel timer

:x: Incorrect

setTimeout(() => {}, 1000)

:white_check_mark: Correct

const timerId = setTimeout(() => {}, 1000)
clearTimeout(timerId)

Attributes