Skip to content

Commit 78d0f73

Browse files
pedrottimarkAndrew Ravn
authored and
Andrew Ravn
committed
chore(ui): Upgrade TypeScript 5.6.2 plus types devDependencies in ui (stackrox#12709)
1 parent 0276494 commit 78d0f73

File tree

5 files changed

+33
-58
lines changed

5 files changed

+33
-58
lines changed

ui/apps/platform/package-lock.json

+20-43
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/apps/platform/package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
"test-watch": "react-app-rewired test",
103103
"lint": "eslint --quiet .",
104104
"lint:fix": "eslint --fix --quiet .",
105+
"tsc": "tsc",
105106
"cypress-open": "./scripts/cypress.sh open --config defaultCommandTimeout=8000",
106107
"cypress-spec": "./scripts/cypress.sh run --spec",
107108
"cypress-component": "./scripts/cypress-component.sh open --component",
@@ -128,11 +129,11 @@
128129
"@testing-library/jest-dom": "^6.5.0",
129130
"@testing-library/react": "^16.0.1",
130131
"@testing-library/user-event": "^14.5.2",
131-
"@types/jest": "^29.5.12",
132-
"@types/lodash": "^4.17.4",
132+
"@types/jest": "^29.5.13",
133+
"@types/lodash": "^4.17.7",
133134
"@types/pluralize": "^0.0.33",
134-
"@types/qs": "^6.9.15",
135-
"@types/react": "^18.3.3",
135+
"@types/qs": "^6.9.16",
136+
"@types/react": "^18.3.6",
136137
"@types/react-dom": "^18.3.0",
137138
"@types/react-redux": "^7.1.33",
138139
"@types/segment-analytics": "^0.0.38",
@@ -169,7 +170,7 @@
169170
"redux-saga-test-plan": "^3.7.0",
170171
"tailwindcss": "^2.0.3",
171172
"ts-jest": "^29.2.5",
172-
"typescript": "^5.5.4"
173+
"typescript": "^5.6.2"
173174
},
174175
"resolutions": {
175176
"@jest/types": "^29.6.3",
@@ -222,7 +223,7 @@
222223
"react-dom": "^18.0.0"
223224
},
224225
"react-scripts": {
225-
"typescript": "5.5.4"
226+
"typescript": "5.6.2"
226227
},
227228
"react-select": {
228229
"react": "^18.0.0",

ui/apps/platform/src/Containers/Collections/errorUtils.ts

-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ export function parseConfigError(err: Error): CollectionConfigError {
3333
const rawMessage = getAxiosErrorMessage(err);
3434

3535
if (/create a loop/.test(rawMessage)) {
36-
// Work around error in TypeScript 5.5.4 upgrade because build does not use target in tsconfig.json file.
37-
// error TS1503: Named capturing groups are only available when targeting 'ES2018' or later.
38-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
39-
// @ts-ignore
4036
const errorRegex = /^edge between '[0-9a-fA-F-]*' and '(?<loopId>[0-9a-fA-F-]*)'/;
4137
const matches = errorRegex.exec(rawMessage);
4238
const loopId = matches?.groups?.loopId;

ui/apps/platform/src/Containers/Vulnerabilities/WorkloadCves/Tables/table.utils.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { gql } from '@apollo/client';
22
import { min } from 'date-fns';
33
import sortBy from 'lodash/sortBy';
4+
import uniq from 'lodash/uniq';
45
import { VulnerabilitySeverity, isVulnerabilitySeverity } from 'types/cve.proto';
56
import { SourceType } from 'types/image.proto';
67
import { ApiSortOption } from 'types/search';
@@ -265,11 +266,11 @@ export function formatVulnerabilityData(
265266
.filter((d): d is string => d !== null);
266267
const oldestDiscoveredVulnDate = min(...allDiscoveredDates);
267268
// TODO This logic is used in many places, could extract to a util
268-
const uniqueComponents = new Set(allVulnerableComponents.map((c) => c.name));
269+
const uniqueComponents = uniq(allVulnerableComponents.map((c) => c.name));
269270
const affectedComponentsText =
270-
uniqueComponents.size === 1
271-
? uniqueComponents.values().next().value
272-
: `${uniqueComponents.size} components`;
271+
uniqueComponents.length === 1
272+
? uniqueComponents[0]
273+
: `${uniqueComponents.length} components`;
273274

274275
const vulnerabilityImages = images
275276
.map((img) => ({

ui/apps/platform/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "es2020",
44
"lib": [
55
"dom",
66
"dom.iterable",

0 commit comments

Comments
 (0)