diff --git a/js/global.d.ts b/js/global.d.ts index 393390ead5..69176af7da 100644 --- a/js/global.d.ts +++ b/js/global.d.ts @@ -1,15 +1,9 @@ -// libraries/classes/Controllers/JavaScriptMessagesController.php -declare var Messages: { [p: string]: string }; - -// templates/javascript/variables.twig -declare var firstDayOfCalendar: string; -declare var themeImagePath: string; -declare var mysqlDocTemplate: string; -declare var maxInputVars: number; - -declare function sprintf(format: string, ...values: (string|number)[]): string; - interface Window { + Messages: { [p: string]: string }; + maxInputVars: number; + mysqlDocTemplate: string; + themeImagePath: string; + firstDayOfCalendar: string; ol: any; opera: any; zxcvbnts: any; @@ -17,6 +11,8 @@ interface Window { u2f: any; drawOpenLayers: () => any; variableNames: string[]; + + sprintf(format: string, ...values: (string|number)[]): string; } interface JQuery { diff --git a/js/src/designer/history.ts b/js/src/designer/history.ts index 10f329723d..9b0b2390f1 100644 --- a/js/src/designer/history.ts +++ b/js/src/designer/history.ts @@ -682,7 +682,7 @@ const queryFrom = function () { var parts = []; var tArray = []; tArray = window.fromArray; - var K = 0; + var K: any = 0; var k; var key; var key2; diff --git a/js/src/makegrid.ts b/js/src/makegrid.ts index 6d6b905c1e..46ad2032e5 100644 --- a/js/src/makegrid.ts +++ b/js/src/makegrid.ts @@ -1129,7 +1129,7 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine var timeFormat = 'HH:mm:ss'; // check for decimal places of seconds if ((Number($td.attr('data-decimals')) > 0) && ($td.attr('data-type').indexOf('time') !== -1)) { - if (datetimeValue && datetimeValue.indexOf('.') === false) { + if (datetimeValue && datetimeValue.indexOf('.') === -1) { datetimeValue += '.'; } diff --git a/js/src/modules/functions/checkNumberOfFields.ts b/js/src/modules/functions/checkNumberOfFields.ts index e718d42533..85cc19ea8c 100644 --- a/js/src/modules/functions/checkNumberOfFields.ts +++ b/js/src/modules/functions/checkNumberOfFields.ts @@ -10,6 +10,7 @@ export default function checkNumberOfFields () { return false; } + // @ts-ignore if (false === window.maxInputVars) { return false; } diff --git a/webpack.config.cjs b/webpack.config.cjs index 7563282c63..e8c290b209 100644 --- a/webpack.config.cjs +++ b/webpack.config.cjs @@ -12,8 +12,6 @@ const publicPath = path.resolve(__dirname, 'public'); const typeScriptErrorsToIgnore = [ 2322, // TS2322: Type '%s' is not assignable to type '%s'. 2345, // TS2345: Argument of type '%s' is not assignable to parameter of type '%s'. - 2367, // TS2367: This comparison appears to be unintentional because the types '%s' and '%s' have no overlap. - 2405, // TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. 2538, // TS2538: Type '%s' cannot be used as an index type. 2769, // TS2769: No overload matches this call. 5096, // TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.