From 5e79acdd575e62252a6f4e92a74b5304d8b6d240 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Wed, 25 Mar 2026 16:28:47 +0100 Subject: [PATCH 1/2] chore(core): Upgrade TypeScript from 4.9.5 to 5.9.3 Closes #5877 Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/core/package.json | 2 +- packages/core/src/js/integrations/nativelinkederrors.ts | 1 + packages/core/src/js/touchevents.tsx | 4 +++- packages/core/src/js/wrapper.ts | 9 ++++----- yarn.lock | 6 +++--- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index cf244d5e51..440c2c5ccd 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -117,7 +117,7 @@ "react-test-renderer": "19.1.0", "rimraf": "^4.1.1", "ts-jest": "^29.3.1", - "typescript": "4.9.5", + "typescript": "~5.9.3", "uglify-js": "^3.17.4", "uuid": "^9.0.1", "xmlhttprequest": "^1.8.0" diff --git a/packages/core/src/js/integrations/nativelinkederrors.ts b/packages/core/src/js/integrations/nativelinkederrors.ts index bfaba41246..48db860ab0 100644 --- a/packages/core/src/js/integrations/nativelinkederrors.ts +++ b/packages/core/src/js/integrations/nativelinkederrors.ts @@ -101,6 +101,7 @@ function walkErrorTree( } else if (isInstanceOf(linkedError, Error)) { exception = exceptionFromError(parser, error[key]); } else if (isPlainObject(linkedError)) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion const plainError = linkedError as Record; exception = { type: typeof plainError.name === 'string' ? plainError.name : undefined, diff --git a/packages/core/src/js/touchevents.tsx b/packages/core/src/js/touchevents.tsx index 907790e262..f713c7e7fb 100644 --- a/packages/core/src/js/touchevents.tsx +++ b/packages/core/src/js/touchevents.tsx @@ -316,8 +316,10 @@ function getLabelValue(props: Record, labelKey: string | undefi ? props[SENTRY_LABEL_PROP_KEY] // For some reason type narrowing doesn't work as expected with indexing when checking it all in one go in // the "check-label" if sentence, so we have to assign it to a variable here first + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion : typeof labelKey === 'string' && typeof props[labelKey] == 'string' && (props[labelKey] as string).length > 0 - ? props[labelKey] as string + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + ? (props[labelKey] as string) : undefined; } diff --git a/packages/core/src/js/wrapper.ts b/packages/core/src/js/wrapper.ts index def9e48960..f47ddcabd4 100644 --- a/packages/core/src/js/wrapper.ts +++ b/packages/core/src/js/wrapper.ts @@ -38,7 +38,7 @@ import { base64StringFromByteArray } from './vendor'; */ export function getRNSentryModule(): Spec | undefined { return isTurboModuleEnabled() - ? ReactNativeLibraries.TurboModuleRegistry?.get('RNSentry') + ? ReactNativeLibraries.TurboModuleRegistry?.get('RNSentry') ?? undefined : NativeModules.RNSentry; } @@ -268,11 +268,10 @@ export const NATIVE: SentryNativeWrapper = { if (!this._isModuleLoaded(RNSentry)) { throw this._NativeClientError; } - const ignoreErrorsStr = options.ignoreErrors?.filter(item => typeof item === 'string') as string[] | undefined; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const ignoreErrorsStr = options.ignoreErrors?.filter((item): item is string => typeof item === 'string'); const ignoreErrorsRegex = options.ignoreErrors - ?.filter(item => item instanceof RegExp) - .map(item => (item as RegExp).source) as string[] | undefined; + ?.filter((item): item is RegExp => item instanceof RegExp) + .map(item => item.source); if (ignoreErrorsStr && ignoreErrorsStr.length > 0) { options.ignoreErrorsStr = ignoreErrorsStr; diff --git a/yarn.lock b/yarn.lock index 165677763d..99d37a50d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11096,7 +11096,7 @@ __metadata: react-test-renderer: 19.1.0 rimraf: ^4.1.1 ts-jest: ^29.3.1 - typescript: 4.9.5 + typescript: ~5.9.3 uglify-js: ^3.17.4 uuid: ^9.0.1 xmlhttprequest: ^1.8.0 @@ -33437,7 +33437,7 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.8.3, typescript@npm:~5.9.2": +"typescript@npm:^5.8.3, typescript@npm:~5.9.2, typescript@npm:~5.9.3": version: 5.9.3 resolution: "typescript@npm:5.9.3" bin: @@ -33487,7 +33487,7 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@^5.8.3#~builtin, typescript@patch:typescript@~5.9.2#~builtin": +"typescript@patch:typescript@^5.8.3#~builtin, typescript@patch:typescript@~5.9.2#~builtin, typescript@patch:typescript@~5.9.3#~builtin": version: 5.9.3 resolution: "typescript@patch:typescript@npm%3A5.9.3#~builtin::version=5.9.3&hash=29ae49" bin: From 7b0d3bde836b7c00f9cdbdf2be6791ce62acf74a Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Wed, 25 Mar 2026 16:35:40 +0100 Subject: [PATCH 2/2] chore(deps): Remove stale security resolutions Remove 7 resolutions whose parent packages are no longer in the dependency tree: @eslint/eslintrc@2.1.4, express@4.19.2, @humanwhocodes/config-array@0.11.14 and @0.13.0, glob@10.4.1, and @appium/support@6.1.1. Co-Authored-By: Claude Opus 4.6 (1M context) --- package.json | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/package.json b/package.json index 98d6ac7a80..987f4557a3 100644 --- a/package.json +++ b/package.json @@ -66,16 +66,11 @@ "front-matter@npm:4.0.2/js-yaml": "^3.14.2", "js-yaml": "^4.1.1", "detox@npm:20.46.0/ajv": "^8.18.0", - "@eslint/eslintrc@npm:2.1.4/ajv": "^6.14.0", "@eslint/eslintrc@npm:3.3.3/ajv": "^6.14.0", "eslint@npm:9.39.4/ajv": "^6.14.0", - "express@npm:4.19.2/path-to-regexp": "0.1.12", "@eslint/config-array@npm:0.21.1/minimatch": "^3.1.3", - "@eslint/eslintrc@npm:2.1.4/minimatch": "^3.1.3", "@eslint/eslintrc@npm:3.3.3/minimatch": "^3.1.3", "@expo/fingerprint@npm:0.6.1/minimatch": "^3.1.3", - "@humanwhocodes/config-array@npm:0.11.14/minimatch": "^3.1.3", - "@humanwhocodes/config-array@npm:0.13.0/minimatch": "^3.1.3", "@lerna/create@npm:8.1.8/minimatch": "^3.1.3", "eslint-plugin-import@npm:2.31.0/minimatch": "^3.1.3", "eslint-plugin-import@npm:2.32.0/minimatch": "^3.1.3", @@ -109,7 +104,6 @@ "@typescript-eslint/typescript-estree@npm:8.56.1/minimatch": "^9.0.7", "@typescript-eslint/typescript-estree@npm:8.57.0/minimatch": "^9.0.7", "editorconfig@npm:1.0.4/minimatch": "^9.0.7", - "glob@npm:10.4.1/minimatch": "^9.0.7", "glob@npm:10.4.5/minimatch": "^9.0.7", "ignore-walk@npm:6.0.5/minimatch": "^9.0.7", "npm-run-all2@npm:6.2.2/minimatch": "^9.0.7", @@ -128,8 +122,7 @@ "on-headers": "^1.1.0", "diff": "^5.2.2", "tar": "^7.5.11", - "tmp": "^0.2.4", - "@appium/support@npm:6.1.1/yauzl": "^3.2.1" + "tmp": "^0.2.4" }, "version": "0.0.0", "name": "sentry-react-native",