Extend joi-date to Joi module in Typescript

Viewed 534

I would like to add @joi/date to joi

According to the JavaScript guide from the official guide, extending the joi is given below

const Joi = require('joi').extend(require('@joi/date'));

How to change this to TypeScript import way?

typescript-eslint says,

Require statement not part of import statement

1 Answers
import BaseJoi from 'joi';
import JoiDate from '@joi/date';
const Joi = BaseJoi.extend(JoiDate);
Related