Task for https://github.com/opensearch-project/OpenSearch-Dashboards/issues/1660…
(inherited from previous project)
```
$tsc --noEmit
...
src/dev/i18n/utils/verify_icu_message.ts:43:15 - error TS2351: This expression is not constructable.
Type 'Error' has no construct signatures.
43 throw new parser.SyntaxError(
~~~~~~~~~~~~~~~~~~
src/dev/i18n/utils/verify_icu_message.ts:54:19 - error TS2351: This expression is not constructable.
Type 'Error' has no construct signatures.
54 throw new parser.SyntaxError(
~~~~~~~~~~~~~~~~~~
src/dev/run_i18n_check.ts:92:23 - error TS2322: Type 'Listr<{ reporter: ErrorReporter; }>' is not assignable to type 'void | ListrTaskResult<{ config: I18nConfig; }>'.
Type 'Listr<{ reporter: ErrorReporter; }>' is not assignable to type 'Listr<{ config: I18nConfig; }>'.
Types of property 'tasks' are incompatible.
Type 'readonly ListrTaskWrapper<{ reporter: ErrorReporter; }>[]' is not assignable to type 'readonly ListrTaskWrapper<{ config: I18nConfig; }>[]'.
Type 'ListrTaskWrapper<{ reporter: ErrorReporter; }>' is not assignable to type 'ListrTaskWrapper<{ config: I18nConfig; }>'.
Type '{ reporter: ErrorReporter; }' is not assignable to type '{ config: I18nConfig; }'.
92 task: () => new Listr(checkConfigs(includeConfig), { exitOnError: true }),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/listr/index.d.ts:33:15
33 task: (ctx: Ctx, task: ListrTaskWrapper<Ctx>) => void | ListrTaskResult<Ctx>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The expected type comes from the return type of this signature.
src/dev/run_i18n_check.ts:92:17
92 task: () => new Listr(checkConfigs(includeConfig), { exitOnError: true }),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Did you mean to mark this function as 'async'?
src/dev/run_i18n_check.ts:96:23 - error TS2322: Type 'Listr<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>' is not assignable to type 'void | ListrTaskResult<{ config: I18nConfig; }>'.
Type 'Listr<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>' is not assignable to type 'Listr<{ config: I18nConfig; }>'.
Types of property 'tasks' are incompatible.
Type 'readonly ListrTaskWrapper<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>[]' is not assignable to type 'readonly ListrTaskWrapper<{ config: I18nConfig; }>[]'.
Type 'ListrTaskWrapper<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>' is not assignable to type 'ListrTaskWrapper<{ config: I18nConfig; }>'.
Type '{ reporter: ErrorReporter; config?: I18nConfig | undefined; }' is not assignable to type '{ config: I18nConfig; }'.
96 task: () => new Listr(mergeConfigs(includeConfig), { exitOnError: true }),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/listr/index.d.ts:33:15
33 task: (ctx: Ctx, task: ListrTaskWrapper<Ctx>) => void | ListrTaskResult<Ctx>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The expected type comes from the return type of this signature.
src/dev/run_i18n_check.ts:96:17
96 task: () => new Listr(mergeConfigs(includeConfig), { exitOnError: true }),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Did you mean to mark this function as 'async'?
src/dev/run_i18n_check.ts:103:13 - error TS2322: Type 'Listr<{ reporter: ErrorReporter; config: I18nConfig; }>' is not assignable to type 'void | ListrTaskResult<{ config: I18nConfig; }>'.
Type 'Listr<{ reporter: ErrorReporter; config: I18nConfig; }>' is not assignable to type 'Listr<{ config: I18nConfig; }>'.
Types of property 'setRenderer' are incompatible.
Type '(value: ListrRendererValue<{ reporter: ErrorReporter; config: I18nConfig; }>) => void' is not assignable to type '(value: ListrRendererValue<{ config: I18nConfig; }>) => void'.
Types of parameters 'value' and 'value' are incompatible.
Type 'ListrRendererValue<{ config: I18nConfig; }>' is not assignable to type 'ListrRendererValue<{ reporter: ErrorReporter; config: I18nConfig; }>'.
Type 'ListrRendererClass<{ config: I18nConfig; }>' is not assignable to type 'ListrRendererValue<{ reporter: ErrorReporter; config: I18nConfig; }>'.
Type 'ListrRendererClass<{ config: I18nConfig; }>' is not assignable to type 'ListrRendererClass<{ reporter: ErrorReporter; config: I18nConfig; }>'.
Types of parameters 'tasks' and 'tasks' are incompatible.
Type 'readonly ListrTaskObject<{ reporter: ErrorReporter; config: I18nConfig; }>[]' is not assignable to type 'readonly ListrTaskObject<{ config: I18nConfig; }>[]'.
Type 'ListrTaskObject<{ reporter: ErrorReporter; config: I18nConfig; }>' is not assignable to type 'ListrTaskObject<{ config: I18nConfig; }>'.
Types of property 'task' are incompatible.
Type '(ctx: { reporter: ErrorReporter; config: I18nConfig; }, task: ListrTaskWrapper<{ reporter: ErrorReporter; config: I18nConfig; }>) => void | ListrTaskResult<{ reporter: ErrorReporter; config: I18nConfig; }>' is not assignable to type '(ctx: { config: I18nConfig; }, task: ListrTaskWrapper<{ config: I18nConfig; }>) => void | ListrTaskResult<{ config: I18nConfig; }>'.
Types of parameters 'ctx' and 'ctx' are incompatible.
Type '{ config: I18nConfig; }' is not assignable to type '{ reporter: ErrorReporter; config: I18nConfig; }'.
103 new Listr(extractUntrackedMessages(srcPaths), { exitOnError: true }),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/listr/index.d.ts:33:15
33 task: (ctx: Ctx, task: ListrTaskWrapper<Ctx>) => void | ListrTaskResult<Ctx>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The expected type comes from the return type of this signature.
src/dev/run_i18n_check.ts:102:17
102 task: ({ config }) =>
~~~~~~~~~~~~~~~
103 new Listr(extractUntrackedMessages(srcPaths), { exitOnError: true }),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Did you mean to mark this function as 'async'?
src/dev/run_i18n_check.ts:109:13 - error TS2322: Type 'Listr<{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }>' is not assignable to type 'void | ListrTaskResult<{ config: I18nConfig; }>'.
Type 'Listr<{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }>' is not assignable to type 'Listr<{ config: I18nConfig; }>'.
Types of property 'tasks' are incompatible.
Type 'readonly ListrTaskWrapper<{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }>[]' is not assignable to type 'readonly ListrTaskWrapper<{ config: I18nConfig; }>[]'.
Type 'ListrTaskWrapper<{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }>' is not assignable to type 'ListrTaskWrapper<{ config: I18nConfig; }>'.
Type '{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }' is not assignable to type '{ config: I18nConfig; }'.
109 new Listr(extractDefaultMessages(config, srcPaths), { exitOnError: true }),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/listr/index.d.ts:33:15
33 task: (ctx: Ctx, task: ListrTaskWrapper<Ctx>) => void | ListrTaskResult<Ctx>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The expected type comes from the return type of this signature.
src/dev/run_i18n_check.ts:108:17
108 task: ({ config }) =>
~~~~~~~~~~~~~~~
109 new Listr(extractDefaultMessages(config, srcPaths), { exitOnError: true }),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Did you mean to mark this function as 'async'?
src/dev/run_i18n_check.ts:115:13 - error TS2322: Type 'Listr<{ messages: Map<string, { message: string; }>; }>' is not assignable to type 'void | ListrTaskResult<{ config: I18nConfig; }>'.
Type 'Listr<{ messages: Map<string, { message: string; }>; }>' is not assignable to type 'Listr<{ config: I18nConfig; }>'.
Types of property 'tasks' are incompatible.
Type 'readonly ListrTaskWrapper<{ messages: Map<string, { message: string; }>; }>[]' is not assignable to type 'readonly ListrTaskWrapper<{ config: I18nConfig; }>[]'.
Type 'ListrTaskWrapper<{ messages: Map<string, { message: string; }>; }>' is not assignable to type 'ListrTaskWrapper<{ config: I18nConfig; }>'.
Type '{ messages: Map<string, { message: string; }>; }' is not assignable to type '{ config: I18nConfig; }'.
115 new Listr(
~~~~~~~~~~
116 checkCompatibility(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
127 { exitOnError: true }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
128 ),
~~~~~~~~~~~~~
node_modules/@types/listr/index.d.ts:33:15
33 task: (ctx: Ctx, task: ListrTaskWrapper<Ctx>) => void | ListrTaskResult<Ctx>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The expected type comes from the return type of this signature.
src/dev/run_i18n_check.ts:114:17
114 task: ({ config }) =>
~~~~~~~~~~~~~~~
115 new Listr(
~~~~~~~~~~~~~~~~~~~~~~
...
127 { exitOnError: true }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
128 ),
~~~~~~~~~~~~~
Did you mean to mark this function as 'async'?
src/dev/run_i18n_check.ts:140:24 - error TS2345: Argument of type '{ messages: Map<string, { message: string; }>; reporter: any; }' is not assignable to parameter of type '{ config: I18nConfig; }'.
Object literal may only specify known properties, and 'messages' does not exist in type '{ config: I18nConfig; }'.
140 await list.run({ messages, reporter });
~~~~~~~~
src/dev/run_i18n_extract.ts:62:18 - error TS2769: No overload matches this call.
Overload 1 of 2, '(tasks?: readonly ListrTask<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>[] | undefined, options?: ListrOptions<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }> | undefined): Listr<...>', gave the following error.
Type 'Listr<{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }>' is not assignable to type 'void | ListrTaskResult<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>'.
Type 'Listr<{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }>' is not assignable to type 'Listr<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>'.
Types of property 'setRenderer' are incompatible.
Type '(value: ListrRendererValue<{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }>) => void' is not assignable to type '(value: ListrRendererValue<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>) => void'.
Types of parameters 'value' and 'value' are incompatible.
Type 'ListrRendererValue<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>' is not assignable to type 'ListrRendererValue<{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }>'.
Type 'ListrRendererClass<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>' is not assignable to type 'ListrRendererValue<{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }>'.
Type 'ListrRendererClass<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>' is not assignable to type 'ListrRendererClass<{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }>'.
Types of parameters 'tasks' and 'tasks' are incompatible.
Type 'readonly ListrTaskObject<{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }>[]' is not assignable to type 'readonly ListrTaskObject<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>[]'.
Type 'ListrTaskObject<{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }>' is not assignable to type 'ListrTaskObject<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>'.
Types of property 'task' are incompatible.
Type '(ctx: { messages: Map<string, { message: string; }>; reporter: ErrorReporter; }, task: ListrTaskWrapper<{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }>) => void | ListrTaskResult<...>' is not assignable to type '(ctx: { reporter: ErrorReporter; config?: I18nConfig | undefined; }, task: ListrTaskWrapper<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>) => void | ListrTaskResult<...>'.
Types of parameters 'ctx' and 'ctx' are incompatible.
Type '{ reporter: ErrorReporter; config?: I18nConfig | undefined; }' is not assignable to type '{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }'.
Overload 2 of 2, '(options?: ListrOptions<any> | undefined): Listr<any>', gave the following error.
Type '({ title: string; task: () => Listr<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>; } | { title: string; task: ({ config }: { reporter: ErrorReporter; config?: I18nConfig | undefined; }) => Listr<...>; } | { ...; })[]' has no properties in common with type 'ListrOptions<any>'.
62 const list = new Listr([
~~~~~~~~~~~
63 {
~~~~~~~
...
86 },
~~~~~~~~
87 ]);
~~~~~~
node_modules/@types/listr/index.d.ts:33:15
33 task: (ctx: Ctx, task: ListrTaskWrapper<Ctx>) => void | ListrTaskResult<Ctx>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The expected type comes from the return type of this signature.
src/dev/run_i18n_extract.ts:69:15
69 task: ({ config }) =>
~~~~~~~~~~~~~~~
70 new Listr(extractDefaultMessages(config, srcPaths), { exitOnError: true }),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Did you mean to mark this function as 'async'?
src/dev/run_i18n_extract.ts:70:44 - error TS2345: Argument of type 'I18nConfig | undefined' is not assignable to parameter of type 'I18nConfig'.
Type 'undefined' is not assignable to type 'I18nConfig'.
70 new Listr(extractDefaultMessages(config, srcPaths), { exitOnError: true }),
~~~~~~
src/dev/run_i18n_extract.ts:74:44 - error TS2339: Property 'messages' does not exist on type '{ reporter: ErrorReporter; config?: I18nConfig | undefined; }'.
74 enabled: (ctx) => outputDir && ctx.messages.size,
~~~~~~~~
src/dev/run_i18n_extract.ts:76:42 - error TS2339: Property 'messages' does not exist on type '{ reporter: ErrorReporter; config?: I18nConfig | undefined; }'.
76 const sortedMessages = [...ctx.messages].sort(([key1], [key2]) =>
~~~~~~~~
src/dev/run_i18n_extract.ts:92:24 - error TS2345: Argument of type '{ messages: Map<string, { message: string; }>; reporter: any; }' is not assignable to parameter of type '{ reporter: ErrorReporter; config?: I18nConfig | undefined; }'.
Object literal may only specify known properties, and 'messages' does not exist in type '{ reporter: ErrorReporter; config?: I18nConfig | undefined; }'.
92 await list.run({ messages, reporter });
~~~~~~~~
src/dev/run_i18n_integrate.ts:93:18 - error TS2769: No overload matches this call.
Overload 1 of 2, '(tasks?: readonly ListrTask<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>[] | undefined, options?: ListrOptions<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }> | undefined): Listr<...>', gave the following error.
Type 'Listr<{ messages: Map<string, { message: string; }>; reporter: ErrorReporter; }>' is not assignable to type 'void | ListrTaskResult<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>'.
Overload 2 of 2, '(options?: ListrOptions<any> | undefined): Listr<any>', gave the following error.
Type '({ title: string; task: () => Listr<{ reporter: ErrorReporter; config?: I18nConfig | undefined; }>; } | { title: string; task: ({ config }: { reporter: ErrorReporter; config?: I18nConfig | undefined; }) => Listr<...>; } | { ...; })[]' has no properties in common with type 'ListrOptions<any>'.
93 const list = new Listr([
~~~~~~~~~~~
94 {
~~~~~~~
...
118 },
~~~~~~~~
119 ]);
~~~~~~
node_modules/@types/listr/index.d.ts:33:15
33 task: (ctx: Ctx, task: ListrTaskWrapper<Ctx>) => void | ListrTaskResult<Ctx>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The expected type comes from the return type of this signature.
src/dev/run_i18n_integrate.ts:100:15
100 task: ({ config }) =>
~~~~~~~~~~~~~~~
101 new Listr(extractDefaultMessages(config, srcPaths), { exitOnError: true }),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Did you mean to mark this function as 'async'?
src/dev/run_i18n_integrate.ts:101:44 - error TS2345: Argument of type 'I18nConfig | undefined' is not assignable to parameter of type 'I18nConfig'.
Type 'undefined' is not assignable to type 'I18nConfig'.
101 new Listr(extractDefaultMessages(config, srcPaths), { exitOnError: true }),
~~~~~~
src/dev/run_i18n_integrate.ts:105:24 - error TS2339: Property 'messages' does not exist on type '{ reporter: ErrorReporter; config?: I18nConfig | undefined; }'.
105 task: async ({ messages, config }) => {
~~~~~~~~
src/dev/run_i18n_integrate.ts:114:13 - error TS2322: Type 'I18nConfig | undefined' is not assignable to type 'I18nConfig'.
Type 'undefined' is not assignable to type 'I18nConfig'.
114 config,
~~~~~~
src/dev/i18n/integrate_locale_files.ts:59:3
59 config: I18nConfig;
~~~~~~
The expected type comes from property 'config' which is declared here on type 'IntegrateOptions'
src/dev/run_i18n_integrate.ts:124:24 - error TS2345: Argument of type '{ messages: Map<string, { message: string; }>; reporter: any; }' is not assignable to parameter of type '{ reporter: ErrorReporter; config?: I18nConfig | undefined; }'.
Object literal may only specify known properties, and 'messages' does not exist in type '{ reporter: ErrorReporter; config?: I18nConfig | undefined; }'.
124 await list.run({ messages, reporter });
```