eslint-plugin

@masknet/no-unsafe-date

Disallow use unsafe Date methods

Rule Details

Mutating dates can create confusing bugs. Instead, create new dates using a library like date-fns.

Only the following methods are allowed

:x: Incorrect

const expiration = new Date()
expiration.setFullYear(2010, 05, 23)
expiration.setHours(12)
expiration.setDate(17)
expiration.setSeconds(30)

Attributes

Thanks

https://github.com/chdsbd/eslint-plugin-better-dates