diff --git a/.yarn/cache/typescript-npm-5.4.5-8568a42232-53c879c6fa.zip b/.yarn/cache/typescript-npm-5.4.5-8568a42232-53c879c6fa.zip deleted file mode 100644 index a84ee9078d..0000000000 Binary files a/.yarn/cache/typescript-npm-5.4.5-8568a42232-53c879c6fa.zip and /dev/null differ diff --git a/.yarn/cache/typescript-npm-5.6.3-cc9b3687b0-ba302f8822.zip b/.yarn/cache/typescript-npm-5.6.3-cc9b3687b0-ba302f8822.zip new file mode 100644 index 0000000000..feac5f41f6 Binary files /dev/null and b/.yarn/cache/typescript-npm-5.6.3-cc9b3687b0-ba302f8822.zip differ diff --git a/.yarn/cache/typescript-patch-6609a90948-ade87bce23.zip b/.yarn/cache/typescript-patch-6609a90948-ade87bce23.zip new file mode 100644 index 0000000000..8c492947d5 Binary files /dev/null and b/.yarn/cache/typescript-patch-6609a90948-ade87bce23.zip differ diff --git a/.yarn/cache/typescript-patch-75f7179b67-2373c693f3.zip b/.yarn/cache/typescript-patch-75f7179b67-2373c693f3.zip deleted file mode 100644 index 7a3890fb27..0000000000 Binary files a/.yarn/cache/typescript-patch-75f7179b67-2373c693f3.zip and /dev/null differ diff --git a/apps/web/package.json b/apps/web/package.json index ea10eee4f9..b94825c711 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -136,7 +136,7 @@ "tailwindcss": "^3.4.15", "tailwindcss-animate": "^1.0.7", "ts-unused-exports": "^10.1.0", - "typescript": "^5.4.5" + "typescript": "^5.6.3" }, "packageManager": "yarn@3.6.1", "engines": { diff --git a/apps/web/src/components/equations-app/equation-task.tsx b/apps/web/src/components/equations-app/equation-task.tsx index 4f61eeea32..7961e215f5 100644 --- a/apps/web/src/components/equations-app/equation-task.tsx +++ b/apps/web/src/components/equations-app/equation-task.tsx @@ -794,7 +794,7 @@ function findActions( } return op }) - .filter((x) => x !== null) as Action[] + .filter((x) => x !== null) } } throw new Error('invalid input') diff --git a/apps/web/src/components/equations-app/equations-app-v2.tsx b/apps/web/src/components/equations-app/equations-app-v2.tsx index bc2387a47a..4e5aa695a0 100644 --- a/apps/web/src/components/equations-app/equations-app-v2.tsx +++ b/apps/web/src/components/equations-app/equations-app-v2.tsx @@ -138,7 +138,7 @@ function readSolved() { sessionStorage.getItem('serlo_gleichungs_app_solved') ?? '[]' ) if (Array.isArray(state) && state.every((x) => typeof x === 'number')) { - return state as number[] + return state } return [] } catch (e) { diff --git a/apps/web/src/components/equations-app/equations-app.tsx b/apps/web/src/components/equations-app/equations-app.tsx index eafb1c879b..07200b0725 100644 --- a/apps/web/src/components/equations-app/equations-app.tsx +++ b/apps/web/src/components/equations-app/equations-app.tsx @@ -963,7 +963,7 @@ function findActions( } return op }) - .filter((x) => x !== null) as Action[] + .filter((x) => x !== null) } } throw new Error('invalid input') diff --git a/apps/web/src/fetcher/create-breadcrumbs.tsx b/apps/web/src/fetcher/create-breadcrumbs.tsx index 209bd50359..157c77b28e 100644 --- a/apps/web/src/fetcher/create-breadcrumbs.tsx +++ b/apps/web/src/fetcher/create-breadcrumbs.tsx @@ -59,9 +59,7 @@ export function taxonomyParentsToRootToBreadcrumbsData( // get the subject from the secondary menu data so we link to the correct landing pages const subject = secondaryMenus.find( - // this is probably a bug in our code, but for now we ignore it: - // eslint-disable-next-line no-constant-binary-expression - (menu) => menu.rootId === breadcrumbs[0]?.id ?? term.id + (menu) => menu.rootId === (breadcrumbs[0]?.id || term.id) ) if (subject) { diff --git a/apps/web/src/pages/___exercise_folder_dashboard/[id].tsx b/apps/web/src/pages/___exercise_folder_dashboard/[id].tsx index a4af0b0e6c..c652006f97 100644 --- a/apps/web/src/pages/___exercise_folder_dashboard/[id].tsx +++ b/apps/web/src/pages/___exercise_folder_dashboard/[id].tsx @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unsafe-argument */ -/* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { faMagnifyingGlass } from '@fortawesome/free-solid-svg-icons' @@ -235,8 +233,8 @@ export default function Page() { Gesamtquote:{' '} {( - (data.versions[start].solved! / - data.versions[start].visits!) * + (data.versions[start].solved / + data.versions[start].visits) * 100 ).toFixed(2)} % @@ -246,7 +244,7 @@ export default function Page() { data.versions[start].medianTimeCount !== undefined && ( Median Arbeitszeit:{' '} - {Math.round(data.versions[start].medianTime! / 1000 / 60)}{' '} + {Math.round(data.versions[start].medianTime / 1000 / 60)}{' '} min ({data.versions[start].medianTimeCount}) )} @@ -269,8 +267,8 @@ export default function Page() { Gesamtquote:{' '} {( - (data.versions[end].solved! / - data.versions[end].visits!) * + (data.versions[end].solved / + data.versions[end].visits) * 100 ).toFixed(2)} % @@ -280,7 +278,7 @@ export default function Page() { data.versions[end].medianTimeCount !== undefined && ( Median Arbeitszeit:{' '} - {Math.round(data.versions[end].medianTime! / 1000 / 60)}{' '} + {Math.round(data.versions[end].medianTime / 1000 / 60)}{' '} min ({data.versions[end].medianTimeCount}) )} @@ -328,6 +326,7 @@ export default function Page() { ){' '} {renderSolved( + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument entry.__id, data.versions[i].start, data.versions[i].end, @@ -360,7 +359,8 @@ export default function Page() { )

{entry.children - ? entry.children.map((child: any) => { + ? // eslint-disable-next-line @typescript-eslint/no-unsafe-call + entry.children.map((child: any) => { return (

Teilaufgabe {child.__id} ( @@ -382,6 +382,7 @@ export default function Page() { ){' '} {renderSolved( + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument child.__id, data.versions[i].start, data.versions[i].end, diff --git a/e2e-tests/tsconfig.json b/e2e-tests/tsconfig.json index a87ba62fe8..393337d61b 100644 --- a/e2e-tests/tsconfig.json +++ b/e2e-tests/tsconfig.json @@ -3,8 +3,8 @@ "files": true }, "compilerOptions": { - "target": "es2018", - "lib": ["es2018", "DOM"], + "target": "ES2018", + "lib": ["ES2018", "DOM"], "esModuleInterop": true, "module": "commonjs", "strictNullChecks": false, diff --git a/packages/editor/package.json b/packages/editor/package.json index 0b9ca57ea8..83a4b312d7 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -124,7 +124,7 @@ "ts-debounce": "^4.0.0", "ts-jest": "^29.2.5", "ts-key-enum": "^2.0.13", - "typescript": "^5.4.5", + "typescript": "^5.6.3", "uuid": "^11.0.3", "vite": "^5.4.11", "vite-plugin-dts": "4.3.0", diff --git a/packages/editor/src/core/sub-document/editor.tsx b/packages/editor/src/core/sub-document/editor.tsx index af66371001..6c5d7de067 100644 --- a/packages/editor/src/core/sub-document/editor.tsx +++ b/packages/editor/src/core/sub-document/editor.tsx @@ -124,6 +124,7 @@ export function SubDocumentEditor({ id, pluginProps }: SubDocumentProps) { const defaultConfig = typeof plugin.config === 'function' ? plugin.config() : plugin.config const overrideConfig = (pluginProps && pluginProps.config) || {} + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const config = R.mergeDeepRight(defaultConfig, overrideConfig) const onChange = ( @@ -153,6 +154,7 @@ export function SubDocumentEditor({ id, pluginProps }: SubDocumentProps) { const isInlineChildEditor = Object.hasOwn(config, 'isInlineChildEditor') && + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access (config.isInlineChildEditor as boolean) const isTemplatePlugin = document.plugin.startsWith('type-') @@ -176,6 +178,7 @@ export function SubDocumentEditor({ id, pluginProps }: SubDocumentProps) { containerRef={containerRef} id={id} focused={focused} + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment config={config} // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment state={state} diff --git a/packages/editor/src/editor-ui/plugin-toolbar/text-controls/utils/blank.ts b/packages/editor/src/editor-ui/plugin-toolbar/text-controls/utils/blank.ts index 3069699f75..91dca66b38 100644 --- a/packages/editor/src/editor-ui/plugin-toolbar/text-controls/utils/blank.ts +++ b/packages/editor/src/editor-ui/plugin-toolbar/text-controls/utils/blank.ts @@ -23,7 +23,7 @@ export function isBlankActive(editor: SlateEditor) { export function getBlankElement(editor: SlateEditor): Blank | undefined { const [match] = Array.from(SlateEditor.nodes(editor, { match: matchBlanks })) - return match && (match[0] as Blank) + return match && match[0] } export function toggleBlank(editor: SlateEditor) { diff --git a/packages/editor/src/editor-ui/plugin-toolbar/text-controls/utils/link.ts b/packages/editor/src/editor-ui/plugin-toolbar/text-controls/utils/link.ts index 65d499decc..e430ca937e 100644 --- a/packages/editor/src/editor-ui/plugin-toolbar/text-controls/utils/link.ts +++ b/packages/editor/src/editor-ui/plugin-toolbar/text-controls/utils/link.ts @@ -13,7 +13,7 @@ export function isLinkActive(editor: SlateEditor) { export function getLinkElement(editor: SlateEditor): Link | undefined { const [match] = Array.from(SlateEditor.nodes(editor, { match: matchLinks })) - return match && (match[0] as Link) + return match && match[0] } export function toggleLink(editor: SlateEditor) { diff --git a/packages/editor/src/plugins/box/renderer.tsx b/packages/editor/src/plugins/box/renderer.tsx index ddfd9b2c12..a6cd5c7a18 100644 --- a/packages/editor/src/plugins/box/renderer.tsx +++ b/packages/editor/src/plugins/box/renderer.tsx @@ -51,7 +51,7 @@ export function BoxRenderer({ const isAttention = boxType === 'attention' const icon = boxTypeIcons[boxType] ? ( - + ) : null return ( diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 8227c534a7..1b4187160f 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -16,6 +16,6 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-react": "^7.37.2", "eslint-plugin-react-hooks": "^5.0.0", - "typescript": "^5.4.5" + "typescript": "^5.6.3" } } diff --git a/packages/typescript-config/base.json b/packages/typescript-config/base.json index 3ada562945..db2159178e 100644 --- a/packages/typescript-config/base.json +++ b/packages/typescript-config/base.json @@ -21,7 +21,7 @@ "resolveJsonModule": true, "skipLibCheck": true, "strict": true, - "target": "es6" + "target": "ES2018" }, "exclude": ["node_modules"] } diff --git a/packages/typescript-config/editor.json b/packages/typescript-config/editor.json index 44924d9ed8..6e3e20dada 100644 --- a/packages/typescript-config/editor.json +++ b/packages/typescript-config/editor.json @@ -3,6 +3,7 @@ "display": "React Library", "extends": "./base.json", "compilerOptions": { - "jsx": "react-jsx" + "jsx": "react-jsx", + "target": "ES2018" } } diff --git a/yarn.lock b/yarn.lock index e9e20a539d..e7db64357f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5877,7 +5877,7 @@ __metadata: ts-debounce: ^4.0.0 ts-jest: ^29.2.5 ts-key-enum: ^2.0.13 - typescript: ^5.4.5 + typescript: ^5.6.3 uuid: ^11.0.3 vite: ^5.4.11 vite-plugin-dts: 4.3.0 @@ -5897,7 +5897,7 @@ __metadata: eslint-plugin-import: ^2.31.0 eslint-plugin-react: ^7.37.2 eslint-plugin-react-hooks: ^5.0.0 - typescript: ^5.4.5 + typescript: ^5.6.3 languageName: unknown linkType: soft @@ -6007,7 +6007,7 @@ __metadata: tippy.js: ^6.3.7 ts-debounce: ^4.0.0 ts-unused-exports: ^10.1.0 - typescript: ^5.4.5 + typescript: ^5.6.3 use-query-params: ^2.2.1 languageName: unknown linkType: soft @@ -18865,13 +18865,13 @@ react-mathquill@Entkenntnis/tmp-react-mathquill: languageName: node linkType: hard -"typescript@npm:^5.4.5": - version: 5.4.5 - resolution: "typescript@npm:5.4.5" +"typescript@npm:^5.6.3": + version: 5.6.3 + resolution: "typescript@npm:5.6.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 53c879c6fa1e3bcb194b274d4501ba1985894b2c2692fa079db03c5a5a7140587a1e04e1ba03184605d35f439b40192d9e138eb3279ca8eee313c081c8bcd9b0 + checksum: ba302f8822777ebefb28b554105f3e074466b671e7444ec6b75dadc008a62f46f373d9e57ceced1c433756d06c8b7dc569a7eefdf3a9573122a49205ff99021a languageName: node linkType: hard @@ -18885,13 +18885,13 @@ react-mathquill@Entkenntnis/tmp-react-mathquill: languageName: node linkType: hard -"typescript@patch:typescript@^5.4.5#~builtin": - version: 5.4.5 - resolution: "typescript@patch:typescript@npm%3A5.4.5#~builtin::version=5.4.5&hash=14eedb" +"typescript@patch:typescript@^5.6.3#~builtin": + version: 5.6.3 + resolution: "typescript@patch:typescript@npm%3A5.6.3#~builtin::version=5.6.3&hash=14eedb" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 2373c693f3b328f3b2387c3efafe6d257b057a142f9a79291854b14ff4d5367d3d730810aee981726b677ae0fd8329b23309da3b6aaab8263dbdccf1da07a3ba + checksum: ade87bce2363ee963eed0e4ca8a312ea02c81873ebd53609bc3f6dc0a57f6e61ad7e3fb8cbb7f7ab8b5081cbee801b023f7c4823ee70b1c447eae050e6c7622b languageName: node linkType: hard