From 5c1d9544bce36d04747c05b9b8e659f4c0b05b84 Mon Sep 17 00:00:00 2001 From: Tatsinnit Date: Wed, 14 Aug 2024 08:14:42 +1200 Subject: [PATCH] Fix the eslin no-unused-vars errors. (#841) Signed-off-by: Tatsat Mishra Co-authored-by: Tatsat Mishra --- webview-ui/package-lock.json | 216 ++++++++++-------- webview-ui/package.json | 4 +- .../helpers/gadgets/profile.ts | 13 +- .../helpers/gadgets/snapshot.ts | 42 ++-- .../InspektorGadget/helpers/gadgets/top.ts | 114 +++++---- .../InspektorGadget/helpers/gadgets/trace.ts | 91 ++++---- 6 files changed, 247 insertions(+), 233 deletions(-) diff --git a/webview-ui/package-lock.json b/webview-ui/package-lock.json index 313e60ef1..67561352a 100644 --- a/webview-ui/package-lock.json +++ b/webview-ui/package-lock.json @@ -23,8 +23,8 @@ "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@types/vscode-webview": "^1.57.5", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", + "@typescript-eslint/eslint-plugin": "^8.0.1", + "@typescript-eslint/parser": "^8.0.1", "@vitejs/plugin-react": "^4.3.1", "eslint": "^8.57.0", "eslint-plugin-react": "^7.35.0", @@ -1354,31 +1354,32 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", - "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.1.tgz", + "integrity": "sha512-5g3Y7GDFsJAnY4Yhvk8sZtFfV6YNF2caLzjrRPUBzewjPCaj0yokePB4LJSobyCzGMzjZZYFbwuzbfDHlimXbQ==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/type-utils": "7.18.0", - "@typescript-eslint/utils": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/type-utils": "8.0.1", + "@typescript-eslint/utils": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^7.0.0", - "eslint": "^8.56.0" + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -1387,26 +1388,27 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", - "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.0.1.tgz", + "integrity": "sha512-5IgYJ9EO/12pOUwiBKFkpU7rS3IU21mtXzB81TNwq2xEybcmAZrE9qwDtsb5uQd9aVO9o0fdabFyAmKveXyujg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/typescript-estree": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", "debug": "^4.3.4" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -1415,16 +1417,17 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", - "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.1.tgz", + "integrity": "sha512-NpixInP5dm7uukMiRyiHjRKkom5RIFA4dfiHvalanD2cF0CLUuQqxfg8PtEUo9yqJI2bBhF+pcSafqnG3UBnRQ==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0" + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -1432,26 +1435,24 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", - "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.0.1.tgz", + "integrity": "sha512-+/UT25MWvXeDX9YaHv1IS6KI1fiuTto43WprE7pgSMswHbn1Jm9GEM4Txp+X74ifOWV8emu2AWcbLhpJAvD5Ng==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "7.18.0", - "@typescript-eslint/utils": "7.18.0", + "@typescript-eslint/typescript-estree": "8.0.1", + "@typescript-eslint/utils": "8.0.1", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependencies": { - "eslint": "^8.56.0" - }, "peerDependenciesMeta": { "typescript": { "optional": true @@ -1459,12 +1460,13 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", - "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.1.tgz", + "integrity": "sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==", "dev": true, + "license": "MIT", "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -1472,13 +1474,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", - "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.1.tgz", + "integrity": "sha512-8V9hriRvZQXPWU3bbiUV4Epo7EvgM6RTs+sUmxp5G//dBGy402S7Fx0W0QkB2fb4obCF8SInoUzvTYtc3bkb5w==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1487,7 +1490,7 @@ "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -1504,6 +1507,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -1513,6 +1517,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -1528,6 +1533,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -1536,38 +1542,40 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", - "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.0.1.tgz", + "integrity": "sha512-CBFR0G0sCt0+fzfnKaciu9IBsKvEKYwN9UZ+eeogK1fYHg4Qxk1yf/wLQkLXlq8wbU2dFlgAesxt8Gi76E8RTA==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0" + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/typescript-estree": "8.0.1" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", - "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.1.tgz", + "integrity": "sha512-W5E+o0UfUcK5EgchLZsyVWqARmsM7v54/qEq6PY3YI5arkgmCzHiuk0zKSJJbm71V0xdRna4BGomkCTXz2/LkQ==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/types": "8.0.1", "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -1750,6 +1758,7 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -2247,6 +2256,7 @@ "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, + "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, @@ -3120,6 +3130,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, + "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -4766,6 +4777,7 @@ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -5274,6 +5286,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -5498,6 +5511,7 @@ "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=16" }, @@ -7128,16 +7142,16 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", - "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.1.tgz", + "integrity": "sha512-5g3Y7GDFsJAnY4Yhvk8sZtFfV6YNF2caLzjrRPUBzewjPCaj0yokePB4LJSobyCzGMzjZZYFbwuzbfDHlimXbQ==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/type-utils": "7.18.0", - "@typescript-eslint/utils": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/type-utils": "8.0.1", + "@typescript-eslint/utils": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -7145,54 +7159,54 @@ } }, "@typescript-eslint/parser": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", - "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.0.1.tgz", + "integrity": "sha512-5IgYJ9EO/12pOUwiBKFkpU7rS3IU21mtXzB81TNwq2xEybcmAZrE9qwDtsb5uQd9aVO9o0fdabFyAmKveXyujg==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/typescript-estree": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", - "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.1.tgz", + "integrity": "sha512-NpixInP5dm7uukMiRyiHjRKkom5RIFA4dfiHvalanD2cF0CLUuQqxfg8PtEUo9yqJI2bBhF+pcSafqnG3UBnRQ==", "dev": true, "requires": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0" + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1" } }, "@typescript-eslint/type-utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", - "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.0.1.tgz", + "integrity": "sha512-+/UT25MWvXeDX9YaHv1IS6KI1fiuTto43WprE7pgSMswHbn1Jm9GEM4Txp+X74ifOWV8emu2AWcbLhpJAvD5Ng==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "7.18.0", - "@typescript-eslint/utils": "7.18.0", + "@typescript-eslint/typescript-estree": "8.0.1", + "@typescript-eslint/utils": "8.0.1", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" } }, "@typescript-eslint/types": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", - "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.1.tgz", + "integrity": "sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", - "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.1.tgz", + "integrity": "sha512-8V9hriRvZQXPWU3bbiUV4Epo7EvgM6RTs+sUmxp5G//dBGy402S7Fx0W0QkB2fb4obCF8SInoUzvTYtc3bkb5w==", "dev": true, "requires": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -7228,24 +7242,24 @@ } }, "@typescript-eslint/utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", - "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.0.1.tgz", + "integrity": "sha512-CBFR0G0sCt0+fzfnKaciu9IBsKvEKYwN9UZ+eeogK1fYHg4Qxk1yf/wLQkLXlq8wbU2dFlgAesxt8Gi76E8RTA==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0" + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/typescript-estree": "8.0.1" } }, "@typescript-eslint/visitor-keys": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", - "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.1.tgz", + "integrity": "sha512-W5E+o0UfUcK5EgchLZsyVWqARmsM7v54/qEq6PY3YI5arkgmCzHiuk0zKSJJbm71V0xdRna4BGomkCTXz2/LkQ==", "dev": true, "requires": { - "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/types": "8.0.1", "eslint-visitor-keys": "^3.4.3" } }, diff --git a/webview-ui/package.json b/webview-ui/package.json index 5f7a3ccf2..11f4170b2 100644 --- a/webview-ui/package.json +++ b/webview-ui/package.json @@ -26,8 +26,8 @@ "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@types/vscode-webview": "^1.57.5", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", + "@typescript-eslint/eslint-plugin": "^8.0.1", + "@typescript-eslint/parser": "^8.0.1", "@vitejs/plugin-react": "^4.3.1", "eslint": "^8.57.0", "eslint-plugin-react": "^7.35.0", diff --git a/webview-ui/src/InspektorGadget/helpers/gadgets/profile.ts b/webview-ui/src/InspektorGadget/helpers/gadgets/profile.ts index 0c9b7eaf8..eee2c5b82 100644 --- a/webview-ui/src/InspektorGadget/helpers/gadgets/profile.ts +++ b/webview-ui/src/InspektorGadget/helpers/gadgets/profile.ts @@ -11,8 +11,14 @@ import { } from "./types"; // CPU -const cpuProfileKeys = [...k8sKeys, ...commandKeys, "pid", "userStack", "kernelStack", "count"] as const; -type CpuProfileKey = (typeof cpuProfileKeys)[number]; +type CpuProfileKey = ( + | typeof k8sKeys[number] + | typeof commandKeys[number] + | "pid" + | "userStack" + | "kernelStack" + | "count" + ); const cpuProfileKeyMetadata: ItemMetadata = { ...k8sKeyMetadata, ...commandKeyMetadata, @@ -21,8 +27,7 @@ const cpuProfileKeyMetadata: ItemMetadata = { kernelStack: { identifier: "kernelStack", name: "Kernel Stack" }, count: { identifier: "gid", name: "GID" }, }; -const derivedCpuProfileKeys = ["stack"] as const; -type DerivedCpuProfileKey = (typeof derivedCpuProfileKeys)[number]; +type DerivedCpuProfileKey = "stack"; const allCpuProfileProperties: ItemProperty[] = [ ...getLiteralProperties(cpuProfileKeyMetadata), getDerivedProperty( diff --git a/webview-ui/src/InspektorGadget/helpers/gadgets/snapshot.ts b/webview-ui/src/InspektorGadget/helpers/gadgets/snapshot.ts index d56e53dc7..b125acca8 100644 --- a/webview-ui/src/InspektorGadget/helpers/gadgets/snapshot.ts +++ b/webview-ui/src/InspektorGadget/helpers/gadgets/snapshot.ts @@ -28,16 +28,15 @@ import { } from "./types"; // Process -const processSnapshotKeys = [ - ...k8sKeys, - ...eventKeys, - ...commandKeys, - ...processThreadKeys, - ...userKeys, - "ppid", - ...mountNsKeys, -] as const; -export type ProcessSnapshotKey = (typeof processSnapshotKeys)[number]; +export type ProcessSnapshotKey = + | typeof k8sKeys[number] + | typeof eventKeys[number] + | typeof commandKeys[number] + | typeof processThreadKeys[number] + | typeof userKeys[number] + | "ppid" + | typeof mountNsKeys[number]; + const processSnapshotKeyMetadata: ItemMetadata = { ...k8sKeyMetadata, ...eventKeyMetadata, @@ -73,16 +72,15 @@ export const processSnapshotMetadata: GadgetMetadata = { }; // Socket -const socketSnapshotKeys = [ - ...k8sKeys, - ...eventKeys, - "netnsid", - "protocol", - ...networkEndpointKeys, - "status", - "inodeNumber", -] as const; -type SocketSnapshotKey = (typeof socketSnapshotKeys)[number]; +type SocketSnapshotKey = + | typeof k8sKeys[number] + | typeof eventKeys[number] + | "netnsid" + | "protocol" + | typeof networkEndpointKeys[number] + | "status" + | "inodeNumber"; + const socketSnapshotKeyMetadata: ItemMetadata = { ...k8sKeyMetadata, ...eventKeyMetadata, @@ -92,8 +90,8 @@ const socketSnapshotKeyMetadata: ItemMetadata = { status: { identifier: "status", name: "Status" }, inodeNumber: { identifier: "inode", name: "Inode" }, }; -const derivedSocketSnapshotKeys = [...derivedNetworkEndpointKeys] as const; -type DerivedSocketSnapshotKey = (typeof derivedSocketSnapshotKeys)[number]; +type DerivedSocketSnapshotKey = typeof derivedNetworkEndpointKeys[number]; + const allSocketSnapshotProperties: ItemProperty[] = [ ...getLiteralProperties(socketSnapshotKeyMetadata), ...derivedNetworkEndpointProperties, diff --git a/webview-ui/src/InspektorGadget/helpers/gadgets/top.ts b/webview-ui/src/InspektorGadget/helpers/gadgets/top.ts index 2b3945828..627a79d29 100644 --- a/webview-ui/src/InspektorGadget/helpers/gadgets/top.ts +++ b/webview-ui/src/InspektorGadget/helpers/gadgets/top.ts @@ -24,19 +24,18 @@ import { } from "./types"; // Blocking IO -const blockIOTopKeys = [ - ...k8sKeys, - ...mountNsKeys, - "pid", - ...commandKeys, - "write", - "major", - "minor", - "bytes", - "us", - "ops", -] as const; -type BlockIOTopKey = (typeof blockIOTopKeys)[number]; +type BlockIOTopKey = + | typeof k8sKeys[number] + | typeof mountNsKeys[number] + | "pid" + | typeof commandKeys[number] + | "write" + | "major" + | "minor" + | "bytes" + | "us" + | "ops"; + const blockIOTopKeyMetadata: ItemMetadata = { ...k8sKeyMetadata, ...mountNsKeyMetadata, @@ -78,25 +77,24 @@ export const blockIOTopMetadata: GadgetMetadata = { }; // eBPF -const ebpfTopKeys = [ - ...k8sKeys, - "progid", - "type", - "name", - "processes.pid", - "processes.comm", - "currentRuntime", - "currentRunCount", - "cumulRuntime", - "cumulRunCount", - "totalRuntime", - "totalRunCount", - "mapMemory", - "mapCount", - "totalCpuUsage", - "perCpuUsage", -] as const; -type EbpfTopKey = (typeof ebpfTopKeys)[number]; +type EbpfTopKey = + | typeof k8sKeys[number] + | "progid" + | "type" + | "name" + | "processes.pid" + | "processes.comm" + | "currentRuntime" + | "currentRunCount" + | "cumulRuntime" + | "cumulRunCount" + | "totalRuntime" + | "totalRunCount" + | "mapMemory" + | "mapCount" + | "totalCpuUsage" + | "perCpuUsage"; + const ebpfTopKeyMetadata: ItemMetadata = { ...k8sKeyMetadata, progid: { identifier: "progid", name: "Program ID" }, @@ -144,19 +142,18 @@ export const ebpfTopMetadata: GadgetMetadata = { }; // File -const fileTopKeys = [ - ...k8sKeys, - ...mountNsKeys, - "pid", - ...commandKeys, - "reads", - "rbytes", - "fileType", - "filename", - "wbytes", - "writes", -] as const; -type FileTopKey = (typeof fileTopKeys)[number]; +type FileTopKey = + | typeof k8sKeys[number] + | typeof mountNsKeys[number] + | "pid" + | typeof commandKeys[number] + | "reads" + | "rbytes" + | "fileType" + | "filename" + | "wbytes" + | "writes"; + const fileTopKeyMetadata: ItemMetadata = { ...k8sKeyMetadata, ...mountNsKeyMetadata, @@ -199,17 +196,16 @@ export const fileTopMetadata: GadgetMetadata = { }; // TCP -const tcpTopKeys = [ - ...k8sKeys, - ...mountNsKeys, - "pid", - ...commandKeys, - "family", - ...networkEndpointKeys, - "sent", - "received", -] as const; -type TcpTopKey = (typeof tcpTopKeys)[number]; +type TcpTopKey = + | typeof k8sKeys[number] + | typeof mountNsKeys[number] + | "pid" + | typeof commandKeys[number] + | "family" + | typeof networkEndpointKeys[number] + | "sent" + | "received"; + const tcpTopKeyMetadata: ItemMetadata = { ...k8sKeyMetadata, ...mountNsKeyMetadata, @@ -220,8 +216,10 @@ const tcpTopKeyMetadata: ItemMetadata = { sent: { identifier: "sent", name: "Sent", valueType: ValueType.Bytes }, received: { identifier: "recv", name: "Recv", valueType: ValueType.Bytes }, }; -const derivedTcpTopKeys = ["ip", ...derivedNetworkEndpointKeys] as const; -type DerivedTcpTopKey = (typeof derivedTcpTopKeys)[number]; +type DerivedTcpTopKey = + | "ip" + | typeof derivedNetworkEndpointKeys[number]; + const allTcpTopProperties: ItemProperty[] = [ ...getLiteralProperties(tcpTopKeyMetadata), // https://github.com/inspektor-gadget/inspektor-gadget/blob/08056695b8cfc02698afcbd41add88acfac4d8cf/pkg/gadgets/top/tcp/types/types.go#L64-L69 diff --git a/webview-ui/src/InspektorGadget/helpers/gadgets/trace.ts b/webview-ui/src/InspektorGadget/helpers/gadgets/trace.ts index 99f881f4c..ecbc3a09f 100644 --- a/webview-ui/src/InspektorGadget/helpers/gadgets/trace.ts +++ b/webview-ui/src/InspektorGadget/helpers/gadgets/trace.ts @@ -28,25 +28,24 @@ import { } from "./types"; // DNS -const dnsTraceKeys = [ - ...k8sKeys, - ...timestampKeys, - ...mountNsKeys, - "netnsid", - ...processThreadKeys, - ...commandKeys, - ...userKeys, - "id", - "qr", - "nameserver", - "pktType", - "qtype", - "name", - "rcode", - "numAnswers", - "addresses", -] as const; -type DnsTraceKey = (typeof dnsTraceKeys)[number]; +type DnsTraceKey = + | typeof k8sKeys[number] + | typeof timestampKeys[number] + | typeof mountNsKeys[number] + | "netnsid" + | typeof processThreadKeys[number] + | typeof commandKeys[number] + | typeof userKeys[number] + | "id" + | "qr" + | "nameserver" + | "pktType" + | "qtype" + | "name" + | "rcode" + | "numAnswers" + | "addresses"; + const dnsTraceKeyMetadata: ItemMetadata = { ...k8sKeyMetadata, ...timestampKeyMetadata, @@ -89,21 +88,20 @@ export const dnsTraceMetadata: GadgetMetadata = { }; // Exec -const execTraceKeys = [ - ...k8sKeys, - ...timestampKeys, - ...mountNsKeys, - "pid", - "ppid", - ...commandKeys, - "ret", - "args", - ...userKeys, - "loginuid", - "sessionid", - "cwd", -] as const; -type ExecTraceKey = (typeof execTraceKeys)[number]; +type ExecTraceKey = + | typeof k8sKeys[number] + | typeof timestampKeys[number] + | typeof mountNsKeys[number] + | "pid" + | "ppid" + | typeof commandKeys[number] + | "ret" + | "args" + | typeof userKeys[number] + | "loginuid" + | "sessionid" + | "cwd"; + const execTraceKeyMetadata: ItemMetadata = { ...k8sKeyMetadata, ...timestampKeyMetadata, @@ -139,16 +137,15 @@ export const execTraceMetadata: GadgetMetadata = { }; // TCP -const tcpTraceKeys = [ - ...k8sKeys, - "operation", - "pid", - ...commandKeys, - "ipversion", - ...networkEndpointKeys, - ...mountNsKeys, -] as const; -type TcpTraceKey = (typeof tcpTraceKeys)[number]; +type TcpTraceKey = + | typeof k8sKeys[number] + | "operation" + | "pid" + | typeof commandKeys[number] + | "ipversion" + | typeof networkEndpointKeys[number] + | typeof mountNsKeys[number]; + const tcpTraceKeyMetadata: ItemMetadata = { ...k8sKeyMetadata, operation: { identifier: "t", name: "T" }, @@ -158,8 +155,10 @@ const tcpTraceKeyMetadata: ItemMetadata = { ...networkEndpointKeyMetadata, ...mountNsKeyMetadata, }; -const derivedTcpTraceKeys = ["t", ...derivedNetworkEndpointKeys] as const; -type DerivedTcpTraceKey = (typeof derivedTcpTraceKeys)[number]; +type DerivedTcpTraceKey = + | "t" + | typeof derivedNetworkEndpointKeys[number]; + const allTcpTraceProperties: ItemProperty[] = [ ...getLiteralProperties(tcpTraceKeyMetadata), ...derivedNetworkEndpointProperties,