Исправлены ошибки линтера

This commit is contained in:
Pavel Gnedov 2023-11-07 02:33:05 +07:00
parent ea8115cbee
commit d43cc54f56

View file

@ -33,8 +33,15 @@ export class CalendarEnhancer implements IssueEnhancerInterface {
public descriptionCalendarParams: DescriptionParserParams,
public calendarEventsKey: string,
) {
const initParams = {useForProjects, customFields, descriptionCalendarParams, calendarEventsKey};
this.logger.debug(`Calendar enhancer init with ${JSON.stringify(initParams)}`);
const initParams = {
useForProjects,
customFields,
descriptionCalendarParams,
calendarEventsKey,
};
this.logger.debug(
`Calendar enhancer init with ${JSON.stringify(initParams)}`,
);
}
async enhance(
@ -49,10 +56,18 @@ export class CalendarEnhancer implements IssueEnhancerInterface {
try {
res[this.calendarEventsKey] = this.getCalendarEvents(res);
} catch (ex) {
this.logger.error(`Error at parsing calendar events, message - ${ex}: ${(ex as Error)?.stack}`);
this.logger.error(
`Error at parsing calendar events, message - ${ex}: ${
(ex as Error)?.stack
}`,
);
return res;
}
this.logger.debug(`Calendar events for #${issue.id}: issue.${this.calendarEventsKey} = ${JSON.stringify(res[this.calendarEventsKey])}`);
this.logger.debug(
`Calendar events for #${issue.id}: issue.${
this.calendarEventsKey
} = ${JSON.stringify(res[this.calendarEventsKey])}`,
);
return res;
}
@ -147,7 +162,9 @@ export class CalendarEnhancer implements IssueEnhancerInterface {
const lines = text.split('\n').map((line) => line.trim());
const calendarStartIndex = lines.indexOf(this.descriptionCalendarParams.title);
const calendarStartIndex = lines.indexOf(
this.descriptionCalendarParams.title,
);
if (calendarStartIndex < 0) return [];
let index = calendarStartIndex + 1;