feat: enable stricter typescript compiler options

This commit is contained in:
2024-01-05 11:55:15 +01:00
parent 7e779b738e
commit 33181941ba
58 changed files with 185 additions and 138 deletions

View File

@@ -48,16 +48,16 @@ const program = new Command()
const options = program.opts();
// create an instance of the PluginClient
const pluginClient = new PluginClient(new HttpClient(), options.backendUrl);
const pluginClient = new PluginClient(new HttpClient(), options['backendUrl']);
// create an instance of your plugin
const plugin = new MinimalPlugin(
// tslint:disable-next-line:no-magic-numbers
Number.parseInt(options.port, 10),
options.pluginName,
options.url,
`/${options.routeName}`,
options.backendUrl,
Number.parseInt(options['port'], 10),
options['pluginName'],
options['url'],
`/${options['routeName']}`,
options['backendUrl'],
new Converter(path.resolve(__dirname, '..', 'src', 'plugin', 'protocol')), // an instance of the converter. Required
// because your requests and response schemas are defined in the plugin. The path should lead to your request and
// response interfaces
@@ -69,7 +69,7 @@ const plugin = new MinimalPlugin(
pluginClient
.registerPlugin(plugin)
.then(() => {
Logger.ok(`Successfully registered plugin '${options.pluginName}' on /${options.routeName} .`);
Logger.ok(`Successfully registered plugin '${options['pluginName']}' on /${options['routeName']} .`);
})
// eslint-disable-next-line unicorn/prefer-top-level-await
.catch((error: Error) => {
@@ -81,7 +81,9 @@ for (const signal of [`exit`, `SIGINT`, `SIGUSR1`, `SIGUSR2`, `SIGTERM`]) {
pluginClient
.unregisterPlugin(plugin)
.then(() => {
Logger.ok(`Successfully unregistered plugin '${options.pluginName}' from /${options.routeName} .`);
Logger.ok(
`Successfully unregistered plugin '${options['pluginName']}' from /${options['routeName']} .`,
);
})
.catch((error: Error) => {
throw error;