consistent-date-clone
UnreleasedConfiguration
rslint.config.ts
Rule Details
Prefer passing an existing Date directly to the Date constructor when
cloning it. Since ECMAScript 2015, new Date(date) copies the original date's
time value without requiring an intermediate number.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
The rule only reports the direct new Date(date.getTime()) shape. Calls with
additional constructor arguments or component-wise date construction are left
unchanged: