Typing moment-timezone Variables

Viewed 16

I recently upgraded to stricter eslint rules and am running into issues typing moment-timezone variables. In the below example scheduleDate is a string and scheduleDateTime is in need of some kind of explicit typing.

Example

import * as moment from "moment-timezone";
...
const scheduleDateTime = moment.utc(scheduleDate);

Errors

@typescript-eslint/no-unsafe-call

Ref

eslint, moment-timezone

0 Answers
Related