Fakerjs unsafe assignment of an any value

162 views Asked by At

Does anyone know why I'm getting the following error when trying to populate an array that I've typed?

Unsafe assignment of an `any` value.eslint@typescript-eslint/no-unsafe-assignment
Unsafe member access .lorem on an `any` value.eslint@typescript-eslint/no-unsafe-member-access
Unsafe call of an `any` typed value.eslint@typescript-eslint/no-unsafe-call

My code is:

import { PrismaClient } from "@prisma/client";
import {faker} from '@faker-js/faker'

const prisma = new PrismaClient();

enum Priority {
    HIGH = 'HIGH',
    MEDIUM = 'MEDIUM',
    LOW = 'LOW'
}

interface Deadline {
    title: string;
    description?:string;
    date: Date;
}   

const deadlines: Deadline[] = Array.from({length:100}, () => ({
    title: faker.lorem.sentences({min: 10, max: 20}),
    description: faker.lorem.sentences({min: 3, max: 30}),
    date: faker.date.future({years: 1})
}))
0

There are 0 answers