X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils%2FConfiguration.ts;h=596b685cbf7be0636f4ec7a0ba74c0668bf0c16b;hb=77b4dcc3d3fbd2148f2723df593cce10174e3358;hp=8b0b1c8fa532c3afdd879dd6f6418576e5531139;hpb=300418e9ba42d252a1a7079dab7904f40561a7ef;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index 8b0b1c8f..596b685c 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -45,7 +45,7 @@ type ConfigurationSectionType = // eslint-disable-next-line @typescript-eslint/no-extraneous-class export class Configuration { - public static configurationChangeCallback: () => Promise + public static configurationChangeCallback?: () => Promise private static readonly configurationFile = join( dirname(fileURLToPath(import.meta.url)), @@ -327,7 +327,8 @@ export class Configuration { ] as StationTemplateUrl[]) Configuration.getConfigurationData()?.stationTemplateUrls.forEach( (stationTemplateUrl: StationTemplateUrl) => { - if (stationTemplateUrl?.['numberOfStation' as keyof StationTemplateUrl] !== undefined) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (stationTemplateUrl['numberOfStation' as keyof StationTemplateUrl] !== undefined) { console.error( `${chalk.green(logPrefix())} ${chalk.red( `Deprecated configuration key 'numberOfStation' usage for template file '${stationTemplateUrl.file}' in 'stationTemplateUrls'. Use 'numberOfStations' instead` @@ -495,7 +496,7 @@ export class Configuration { string, unknown > - )?.[key] !== undefined + )[key] !== undefined ) { console.error( `${chalk.green(logPrefix())} ${chalk.red(