date-holidays
date-holidays copied to clipboard
[3.16.5][Typescript] 1:20 error HolidaysTypes not found in 'date-holidays' import/named
It happens now and worked before.
eslint --ext ".js,.ts,.vue" --ignore-path .gitignore --fix .
1:20 error HolidaysTypes not found in 'date-holidays' import/named
✖ 1 problem (1 error, 0 warnings)
Process finished with exit code 1
IntelliJ tells me
ESLint: HolidaysTypes not found in 'date-holidays'(import/named)
My code
import Holidays, { HolidaysTypes } from 'date-holidays'
import EventBuilder from '~/models/builder/events/calendar/EventBuilder'
import EEvent from '~/models/enums/EEvent'
export default function useCalendar() {
const holidays = new Holidays('DE', { languages: ['de'] })
return {
getHolidays: (year: number) =>
holidays.getHolidays(year).map((it: HolidaysTypes.Holiday) => new EventBuilder().allDay(true).category(EEvent.Feiertag).date(it.start, it.end).name(it.name).build()),
}
}