From 41807a7b430ca16ad8422bbf66fec772915a2a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemek=20Wi=C4=99ch?= Date: Mon, 13 Jan 2025 17:43:08 +0100 Subject: [PATCH] Upgrade typescript version --- package-lock.json | 90 ++++++++++++++++++++-------------------- package.json | 2 +- src/index.tsx | 2 +- src/menu/search_index.ts | 14 ++++--- tsconfig.json | 1 - 5 files changed, 56 insertions(+), 53 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3a9fff9..0bda1b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -72,7 +72,7 @@ "run-script-os": "^1.1.6", "start-server-and-test": "^2.0.9", "tslint-config-prettier": "^1.18.0", - "typescript": "^4.2.3" + "typescript": "^5.7.3" } }, "node_modules/@alloc/quick-lru": { @@ -2763,28 +2763,6 @@ "tslib": "^2.1.0" } }, - "node_modules/@formatjs/intl": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.2.1.tgz", - "integrity": "sha512-vgvyUOOrzqVaOFYzTf2d3+ToSkH2JpR7x/4U1RyoHQLmvEaTQvXJ7A2qm1Iy3brGNXC/+/7bUlc3lpH+h/LOJA==", - "dependencies": { - "@formatjs/ecma402-abstract": "1.11.4", - "@formatjs/fast-memoize": "1.2.1", - "@formatjs/icu-messageformat-parser": "2.1.0", - "@formatjs/intl-displaynames": "5.4.3", - "@formatjs/intl-listformat": "6.5.3", - "intl-messageformat": "9.13.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "typescript": "^4.5" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, "node_modules/@formatjs/intl-displaynames": { "version": "5.4.3", "resolved": "https://registry.npmjs.org/@formatjs/intl-displaynames/-/intl-displaynames-5.4.3.tgz", @@ -17768,6 +17746,28 @@ } } }, + "node_modules/react-intl/node_modules/@formatjs/intl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.2.1.tgz", + "integrity": "sha512-vgvyUOOrzqVaOFYzTf2d3+ToSkH2JpR7x/4U1RyoHQLmvEaTQvXJ7A2qm1Iy3brGNXC/+/7bUlc3lpH+h/LOJA==", + "dependencies": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/fast-memoize": "1.2.1", + "@formatjs/icu-messageformat-parser": "2.1.0", + "@formatjs/intl-displaynames": "5.4.3", + "@formatjs/intl-listformat": "6.5.3", + "intl-messageformat": "9.13.0", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "typescript": "^4.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -21327,16 +21327,16 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", "devOptional": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/uc.micro": { @@ -24538,20 +24538,6 @@ "tslib": "^2.1.0" } }, - "@formatjs/intl": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.2.1.tgz", - "integrity": "sha512-vgvyUOOrzqVaOFYzTf2d3+ToSkH2JpR7x/4U1RyoHQLmvEaTQvXJ7A2qm1Iy3brGNXC/+/7bUlc3lpH+h/LOJA==", - "requires": { - "@formatjs/ecma402-abstract": "1.11.4", - "@formatjs/fast-memoize": "1.2.1", - "@formatjs/icu-messageformat-parser": "2.1.0", - "@formatjs/intl-displaynames": "5.4.3", - "@formatjs/intl-listformat": "6.5.3", - "intl-messageformat": "9.13.0", - "tslib": "^2.1.0" - } - }, "@formatjs/intl-displaynames": { "version": "5.4.3", "resolved": "https://registry.npmjs.org/@formatjs/intl-displaynames/-/intl-displaynames-5.4.3.tgz", @@ -35559,6 +35545,22 @@ "hoist-non-react-statics": "^3.3.2", "intl-messageformat": "9.13.0", "tslib": "^2.1.0" + }, + "dependencies": { + "@formatjs/intl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.2.1.tgz", + "integrity": "sha512-vgvyUOOrzqVaOFYzTf2d3+ToSkH2JpR7x/4U1RyoHQLmvEaTQvXJ7A2qm1Iy3brGNXC/+/7bUlc3lpH+h/LOJA==", + "requires": { + "@formatjs/ecma402-abstract": "1.11.4", + "@formatjs/fast-memoize": "1.2.1", + "@formatjs/icu-messageformat-parser": "2.1.0", + "@formatjs/intl-displaynames": "5.4.3", + "@formatjs/intl-listformat": "6.5.3", + "intl-messageformat": "9.13.0", + "tslib": "^2.1.0" + } + } } }, "react-is": { @@ -38218,9 +38220,9 @@ } }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", "devOptional": true }, "uc.micro": { diff --git a/package.json b/package.json index bf45d05..3e49db0 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "run-script-os": "^1.1.6", "start-server-and-test": "^2.0.9", "tslint-config-prettier": "^1.18.0", - "typescript": "^4.2.3" + "typescript": "^5.7.3" }, "scripts": { "start": "run-script-os", diff --git a/src/index.tsx b/src/index.tsx index 723b65d..2799722 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -15,7 +15,7 @@ import './index.css'; import 'semantic-ui-css/semantic.min.css'; import 'canvas-toBlob'; -const messages = { +const messages: {[language: string]: {[message_id: string]: string}} = { cs: messages_cs, de: messages_de, fr: messages_fr, diff --git a/src/menu/search_index.ts b/src/menu/search_index.ts index e8622ba..a7fe5b0 100644 --- a/src/menu/search_index.ts +++ b/src/menu/search_index.ts @@ -106,19 +106,21 @@ class LunrSearchIndex implements SearchIndex { const pipelineFunctions: PipelineFunction[] = []; const searchPipelineFunctions: PipelineFunction[] = []; languages.forEach((language) => { + // @ts-ignore + const lunrLanguage = lunr[language]; if (language === 'en') { wordCharacters += '\\w'; pipelineFunctions.unshift(lunr.stopWordFilter); pipelineFunctions.push(lunr.stemmer); searchPipelineFunctions.push(lunr.stemmer); } else { - wordCharacters += lunr[language].wordCharacters; - if (lunr[language].stopWordFilter) { - pipelineFunctions.unshift(lunr[language].stopWordFilter); + wordCharacters += lunrLanguage.wordCharacters; + if (lunrLanguage.stopWordFilter) { + pipelineFunctions.unshift(lunrLanguage.stopWordFilter); } - if (lunr[language].stemmer) { - pipelineFunctions.push(lunr[language].stemmer); - searchPipelineFunctions.push(lunr[language].stemmer); + if (lunrLanguage.stemmer) { + pipelineFunctions.push(lunrLanguage.stemmer); + searchPipelineFunctions.push(lunrLanguage.stemmer); } } }); diff --git a/tsconfig.json b/tsconfig.json index 2b6592a..5a76369 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,6 @@ "noEmit": true, "jsx": "react-jsx", "allowSyntheticDefaultImports": true, - "suppressImplicitAnyIndexErrors": true, "sourceMap": true, "noFallthroughCasesInSwitch": true },