From 7fcf432d572646e01e9f48a1c9f2b137ba6a05b6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 10:21:12 +0000 Subject: [PATCH 1/4] Update dependency typescript to v5.7.2 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index ac749311703..33339be213b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,7 +48,7 @@ "stylelint": "15.11.0", "tar": "7.4.3", "tmp": "0.2.3", - "typescript": "5.6.3", + "typescript": "5.7.2", "vue-eslint-parser": "9.4.3", "yaml": "2.6.1" }, @@ -11432,9 +11432,9 @@ } }, "node_modules/typescript": { - "version": "5.6.3", - "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index d9a5c5c6632..11e83a1c7d0 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "stylelint": "15.11.0", "tar": "7.4.3", "tmp": "0.2.3", - "typescript": "5.6.3", + "typescript": "5.7.2", "vue-eslint-parser": "9.4.3", "yaml": "2.6.1" }, From 593ee0428420f94602c23bd4ebd6e8b545ef8994 Mon Sep 17 00:00:00 2001 From: Tibor Blenessy Date: Thu, 28 Nov 2024 12:06:27 +0100 Subject: [PATCH 2/4] Fix S3800: typed arrays have different string representation in TS 5.7 --- packages/jsts/src/rules/S3800/rule.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/jsts/src/rules/S3800/rule.ts b/packages/jsts/src/rules/S3800/rule.ts index 7f4df4b58aa..e483fd09409 100644 --- a/packages/jsts/src/rules/S3800/rule.ts +++ b/packages/jsts/src/rules/S3800/rule.ts @@ -172,7 +172,9 @@ function prettyPrint(type: ts.Type, checker: ts.TypeChecker): string { } function isTypedArray(type: ts.Type, checker: ts.TypeChecker) { - return checker.typeToString(type).endsWith('Array'); + const typeAsString = checker.typeToString(type); + // Since TS 5.7 typed arrays include the type of the elements in the string, eg. Float32Array + return /.*Array(?:<.*>)?$/.test(typeAsString); } function isNullLike(type: ts.Type) { From b7f7c2fe39cbd1b8a54c5f3a799d2db8596ae15a Mon Sep 17 00:00:00 2001 From: Tibor Blenessy Date: Thu, 28 Nov 2024 13:25:05 +0100 Subject: [PATCH 3/4] Update ruling test --- its/ruling/src/test/expected/jsts/router/javascript-S1874.json | 1 - 1 file changed, 1 deletion(-) diff --git a/its/ruling/src/test/expected/jsts/router/javascript-S1874.json b/its/ruling/src/test/expected/jsts/router/javascript-S1874.json index ff16bac545c..807f010b3db 100644 --- a/its/ruling/src/test/expected/jsts/router/javascript-S1874.json +++ b/its/ruling/src/test/expected/jsts/router/javascript-S1874.json @@ -4,7 +4,6 @@ 100 ], "router:third_party/brick/brick-1.0.1.byob.js": [ -337, 877, 1412, 1637, From b50ec6c0b6c0944f29378369fa13e6d88253b97d Mon Sep 17 00:00:00 2001 From: Tibor Blenessy Date: Thu, 28 Nov 2024 13:47:47 +0100 Subject: [PATCH 4/4] Fix potentional non-linear regex hotspot --- packages/jsts/src/rules/S3800/rule.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jsts/src/rules/S3800/rule.ts b/packages/jsts/src/rules/S3800/rule.ts index e483fd09409..623e9fcecbf 100644 --- a/packages/jsts/src/rules/S3800/rule.ts +++ b/packages/jsts/src/rules/S3800/rule.ts @@ -174,7 +174,7 @@ function prettyPrint(type: ts.Type, checker: ts.TypeChecker): string { function isTypedArray(type: ts.Type, checker: ts.TypeChecker) { const typeAsString = checker.typeToString(type); // Since TS 5.7 typed arrays include the type of the elements in the string, eg. Float32Array - return /.*Array(?:<.*>)?$/.test(typeAsString); + return /.*Array(?:<[^>]*>)?$/.test(typeAsString); } function isNullLike(type: ts.Type) {