diff --git a/extensions/ql-vscode/.eslintignore b/extensions/ql-vscode/.eslintignore index 73702ce5402..a04d542eaa5 100644 --- a/extensions/ql-vscode/.eslintignore +++ b/extensions/ql-vscode/.eslintignore @@ -3,5 +3,14 @@ node_modules/ out/ build/ +# Ignore js files +.eslintrc.js +jest.config.js +test/vscode-tests/activated-extension/jest-runner-vscode.config.js +test/vscode-tests/cli-integration/jest-runner-vscode.config.js +test/vscode-tests/jest-runner-vscode.config.base.js +test/vscode-tests/minimal-workspace/jest-runner-vscode.config.js +test/vscode-tests/no-workspace/jest-runner-vscode.config.js + # Include the Storybook config !.storybook diff --git a/extensions/ql-vscode/.eslintrc.js b/extensions/ql-vscode/.eslintrc.js index a6a4d56b694..eeac6beceb9 100644 --- a/extensions/ql-vscode/.eslintrc.js +++ b/extensions/ql-vscode/.eslintrc.js @@ -45,7 +45,7 @@ const baseConfig = { "@typescript-eslint/no-invalid-this": "off", "@typescript-eslint/no-shadow": "off", "prefer-const": ["warn", { destructuring: "all" }], - "@typescript-eslint/no-throw-literal": "error", + "@typescript-eslint/only-throw-error": "error", "@typescript-eslint/consistent-type-imports": "error", "import/consistent-type-specifier-style": ["error", "prefer-top-level"], curly: ["error", "all"], @@ -133,18 +133,7 @@ module.exports = { ...baseConfig.rules, // We want to allow mocking of functions in modules, so we need to allow namespace imports. "import/no-namespace": "off", - "@typescript-eslint/ban-types": [ - "error", - { - // For a full list of the default banned types, see: - // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-types.md - extendDefaults: true, - types: { - // Don't complain about the `Function` type in test files. (Default is `true`.) - Function: false, - }, - }, - ], + "@typescript-eslint/no-unsafe-function-type": "off", }, }, { diff --git a/extensions/ql-vscode/gulpfile.ts/appInsights.ts b/extensions/ql-vscode/gulpfile.ts/appInsights.ts index 8e96f286675..e5dba3fd17e 100644 --- a/extensions/ql-vscode/gulpfile.ts/appInsights.ts +++ b/extensions/ql-vscode/gulpfile.ts/appInsights.ts @@ -1,5 +1,5 @@ import { src, dest } from "gulp"; -// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-commonjs +// eslint-disable-next-line @typescript-eslint/no-require-imports,import/no-commonjs const replace = require("gulp-replace"); /** Inject the application insights key into the telemetry file */ diff --git a/extensions/ql-vscode/package-lock.json b/extensions/ql-vscode/package-lock.json index c3c1e168584..d6f372a288d 100644 --- a/extensions/ql-vscode/package-lock.json +++ b/extensions/ql-vscode/package-lock.json @@ -94,8 +94,8 @@ "@types/tmp": "^0.2.6", "@types/vscode": "^1.82.0", "@types/yauzl": "^2.10.3", - "@typescript-eslint/eslint-plugin": "^7.5.0", - "@typescript-eslint/parser": "^7.5.0", + "@typescript-eslint/eslint-plugin": "^8.0.1", + "@typescript-eslint/parser": "^8.0.1", "@vscode/test-electron": "^2.3.9", "@vscode/vsce": "^2.24.0", "ansi-colors": "^4.1.1", @@ -6836,33 +6836,31 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.5.0.tgz", - "integrity": "sha512-HpqNTH8Du34nLxbKgVMGljZMG0rJd2O9ecvr2QLYp+7512ty1j42KnsFwspPXg1Vh8an9YImf6CokUBltisZFQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.1.tgz", + "integrity": "sha512-5g3Y7GDFsJAnY4Yhvk8sZtFfV6YNF2caLzjrRPUBzewjPCaj0yokePB4LJSobyCzGMzjZZYFbwuzbfDHlimXbQ==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "7.5.0", - "@typescript-eslint/type-utils": "7.5.0", - "@typescript-eslint/utils": "7.5.0", - "@typescript-eslint/visitor-keys": "7.5.0", - "debug": "^4.3.4", + "@eslint-community/regexpp": "^4.10.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.2.4", + "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "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": { @@ -6871,16 +6869,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.5.0.tgz", - "integrity": "sha512-Z1r7uJY0MDeUlql9XJ6kRVgk/sP11sr3HKXn268HZyqL7i4cEfrdFuSSY/0tUqT37l5zT0tJOsuDP16kio85iA==", + "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, "dependencies": { - "@typescript-eslint/types": "7.5.0", - "@typescript-eslint/visitor-keys": "7.5.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", @@ -6888,12 +6886,12 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.5.0.tgz", - "integrity": "sha512-tv5B4IHeAdhR7uS4+bf8Ov3k793VEVHd45viRRkehIUZxm0WF82VPiLgHzA/Xl4TGPg1ZD49vfxBKFPecD5/mg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.1.tgz", + "integrity": "sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==", "dev": true, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -6901,22 +6899,22 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.5.0.tgz", - "integrity": "sha512-YklQQfe0Rv2PZEueLTUffiQGKQneiIEKKnfIqPIOxgM9lKSZFCjT5Ad4VqRKj/U4+kQE3fa8YQpskViL7WjdPQ==", + "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, "dependencies": { - "@typescript-eslint/types": "7.5.0", - "@typescript-eslint/visitor-keys": "7.5.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", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.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", @@ -6929,41 +6927,38 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.5.0.tgz", - "integrity": "sha512-3vZl9u0R+/FLQcpy2EHyRGNqAS/ofJ3Ji8aebilfJe+fobK8+LbIFmrHciLVDxjDoONmufDcnVSF38KwMEOjzw==", + "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, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "7.5.0", - "@typescript-eslint/types": "7.5.0", - "@typescript-eslint/typescript-estree": "7.5.0", - "semver": "^7.5.4" + "@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/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.5.0.tgz", - "integrity": "sha512-mcuHM/QircmA6O7fy6nn2w/3ditQkj+SgtOc8DW3uQ10Yfj42amm2i+6F2K4YAOPNNTmE6iM1ynM6lrSwdendA==", + "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, "dependencies": { - "@typescript-eslint/types": "7.5.0", - "eslint-visitor-keys": "^3.4.1" + "@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", @@ -6980,9 +6975,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -7136,26 +7131,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.5.0.tgz", - "integrity": "sha512-cj+XGhNujfD2/wzR1tabNsidnYRaFfEkcULdcIyVBYcXjBvBKOes+mpMBP7hMpOyk+gBcfXsrg4NBGAStQyxjQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.0.1.tgz", + "integrity": "sha512-5IgYJ9EO/12pOUwiBKFkpU7rS3IU21mtXzB81TNwq2xEybcmAZrE9qwDtsb5uQd9aVO9o0fdabFyAmKveXyujg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.5.0", - "@typescript-eslint/types": "7.5.0", - "@typescript-eslint/typescript-estree": "7.5.0", - "@typescript-eslint/visitor-keys": "7.5.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": { @@ -7164,16 +7159,16 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.5.0.tgz", - "integrity": "sha512-Z1r7uJY0MDeUlql9XJ6kRVgk/sP11sr3HKXn268HZyqL7i4cEfrdFuSSY/0tUqT37l5zT0tJOsuDP16kio85iA==", + "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, "dependencies": { - "@typescript-eslint/types": "7.5.0", - "@typescript-eslint/visitor-keys": "7.5.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", @@ -7181,12 +7176,12 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.5.0.tgz", - "integrity": "sha512-tv5B4IHeAdhR7uS4+bf8Ov3k793VEVHd45viRRkehIUZxm0WF82VPiLgHzA/Xl4TGPg1ZD49vfxBKFPecD5/mg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.1.tgz", + "integrity": "sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==", "dev": true, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -7194,22 +7189,22 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.5.0.tgz", - "integrity": "sha512-YklQQfe0Rv2PZEueLTUffiQGKQneiIEKKnfIqPIOxgM9lKSZFCjT5Ad4VqRKj/U4+kQE3fa8YQpskViL7WjdPQ==", + "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, "dependencies": { - "@typescript-eslint/types": "7.5.0", - "@typescript-eslint/visitor-keys": "7.5.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", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.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", @@ -7222,16 +7217,16 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.5.0.tgz", - "integrity": "sha512-mcuHM/QircmA6O7fy6nn2w/3ditQkj+SgtOc8DW3uQ10Yfj42amm2i+6F2K4YAOPNNTmE6iM1ynM6lrSwdendA==", + "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, "dependencies": { - "@typescript-eslint/types": "7.5.0", - "eslint-visitor-keys": "^3.4.1" + "@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", @@ -7248,9 +7243,9 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -7280,26 +7275,23 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.5.0.tgz", - "integrity": "sha512-A021Rj33+G8mx2Dqh0nMO9GyjjIBK3MqgVgZ2qlKf6CJy51wY/lkkFqq3TqqnH34XyAHUkq27IjlUkWlQRpLHw==", + "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, "dependencies": { - "@typescript-eslint/typescript-estree": "7.5.0", - "@typescript-eslint/utils": "7.5.0", + "@typescript-eslint/typescript-estree": "8.0.1", + "@typescript-eslint/utils": "8.0.1", "debug": "^4.3.4", - "ts-api-utils": "^1.0.1" + "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 @@ -7307,16 +7299,16 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.5.0.tgz", - "integrity": "sha512-Z1r7uJY0MDeUlql9XJ6kRVgk/sP11sr3HKXn268HZyqL7i4cEfrdFuSSY/0tUqT37l5zT0tJOsuDP16kio85iA==", + "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, "dependencies": { - "@typescript-eslint/types": "7.5.0", - "@typescript-eslint/visitor-keys": "7.5.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", @@ -7324,12 +7316,12 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.5.0.tgz", - "integrity": "sha512-tv5B4IHeAdhR7uS4+bf8Ov3k793VEVHd45viRRkehIUZxm0WF82VPiLgHzA/Xl4TGPg1ZD49vfxBKFPecD5/mg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.1.tgz", + "integrity": "sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==", "dev": true, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -7337,22 +7329,22 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.5.0.tgz", - "integrity": "sha512-YklQQfe0Rv2PZEueLTUffiQGKQneiIEKKnfIqPIOxgM9lKSZFCjT5Ad4VqRKj/U4+kQE3fa8YQpskViL7WjdPQ==", + "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, "dependencies": { - "@typescript-eslint/types": "7.5.0", - "@typescript-eslint/visitor-keys": "7.5.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", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.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", @@ -7365,41 +7357,38 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.5.0.tgz", - "integrity": "sha512-3vZl9u0R+/FLQcpy2EHyRGNqAS/ofJ3Ji8aebilfJe+fobK8+LbIFmrHciLVDxjDoONmufDcnVSF38KwMEOjzw==", + "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, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "7.5.0", - "@typescript-eslint/types": "7.5.0", - "@typescript-eslint/typescript-estree": "7.5.0", - "semver": "^7.5.4" + "@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/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.5.0.tgz", - "integrity": "sha512-mcuHM/QircmA6O7fy6nn2w/3ditQkj+SgtOc8DW3uQ10Yfj42amm2i+6F2K4YAOPNNTmE6iM1ynM6lrSwdendA==", + "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, "dependencies": { - "@typescript-eslint/types": "7.5.0", - "eslint-visitor-keys": "^3.4.1" + "@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", @@ -7416,9 +7405,9 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -11855,6 +11844,215 @@ "eslint": "^8.0.1" } }, + "node_modules/eslint-plugin-github/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==", + "dev": true, + "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", + "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" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-github/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==", + "dev": true, + "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", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-github/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==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-plugin-github/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==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/utils": "7.18.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-github/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==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-plugin-github/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==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-github/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==", + "dev": true, + "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" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/eslint-plugin-github/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==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.18.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-plugin-github/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/eslint-plugin-github/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/eslint-plugin-i18n-text": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/eslint-plugin-i18n-text/-/eslint-plugin-i18n-text-1.0.1.tgz", @@ -14932,9 +15130,9 @@ ] }, "node_modules/ignore": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", - "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, "engines": { "node": ">= 4" @@ -23890,12 +24088,12 @@ } }, "node_modules/ts-api-utils": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", - "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", "dev": true, "engines": { - "node": ">=16.13.0" + "node": ">=16" }, "peerDependencies": { "typescript": ">=4.2.0" diff --git a/extensions/ql-vscode/package.json b/extensions/ql-vscode/package.json index 3283a9ac84a..10daf76faac 100644 --- a/extensions/ql-vscode/package.json +++ b/extensions/ql-vscode/package.json @@ -2051,8 +2051,8 @@ "@types/tmp": "^0.2.6", "@types/vscode": "^1.82.0", "@types/yauzl": "^2.10.3", - "@typescript-eslint/eslint-plugin": "^7.5.0", - "@typescript-eslint/parser": "^7.5.0", + "@typescript-eslint/eslint-plugin": "^8.0.1", + "@typescript-eslint/parser": "^8.0.1", "@vscode/test-electron": "^2.3.9", "@vscode/vsce": "^2.24.0", "ansi-colors": "^4.1.1", diff --git a/extensions/ql-vscode/src/codeql-cli/cli.ts b/extensions/ql-vscode/src/codeql-cli/cli.ts index 9ccdd9362b7..431713152fa 100644 --- a/extensions/ql-vscode/src/codeql-cli/cli.ts +++ b/extensions/ql-vscode/src/codeql-cli/cli.ts @@ -943,7 +943,7 @@ export class CodeQLCliServer implements Disposable { if (line.startsWith("Enter value for --github-auth-stdin")) { try { return await this.app.credentials.getAccessToken(); - } catch (e) { + } catch { // If the user cancels the authentication prompt, we still need to give a value to the CLI. // By giving a potentially invalid value, the user will just get a 401/403 when they try to access a // private package and the access token is invalid. diff --git a/extensions/ql-vscode/src/codeql-cli/query-language.ts b/extensions/ql-vscode/src/codeql-cli/query-language.ts index ba327560dde..17430ee06a5 100644 --- a/extensions/ql-vscode/src/codeql-cli/query-language.ts +++ b/extensions/ql-vscode/src/codeql-cli/query-language.ts @@ -36,7 +36,7 @@ export async function findLanguage( void extLogger.log( "Query language is unsupported. Select language manually.", ); - } catch (e) { + } catch { void extLogger.log( "Could not autodetect query language. Select language manually.", ); diff --git a/extensions/ql-vscode/src/common/github-url-identifier-helper.ts b/extensions/ql-vscode/src/common/github-url-identifier-helper.ts index 3f5a8e2dbe7..1ea4e327b9d 100644 --- a/extensions/ql-vscode/src/common/github-url-identifier-helper.ts +++ b/extensions/ql-vscode/src/common/github-url-identifier-helper.ts @@ -78,7 +78,7 @@ function getNwoOrOwnerFromGitHubUrl( } const nwo = `${paths[0]}/${paths[1]}`; return paths[1] ? nwo : undefined; - } catch (e) { + } catch { // Ignore the error here, since we catch failures at a higher level. return; } diff --git a/extensions/ql-vscode/src/common/readonly.ts b/extensions/ql-vscode/src/common/readonly.ts index 19a4ad963ef..e202bea52bd 100644 --- a/extensions/ql-vscode/src/common/readonly.ts +++ b/extensions/ql-vscode/src/common/readonly.ts @@ -1,14 +1,14 @@ export type DeepReadonly = T extends Array ? DeepReadonlyArray - : // eslint-disable-next-line @typescript-eslint/ban-types + : // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type T extends Function ? T : T extends object ? DeepReadonlyObject : T; -interface DeepReadonlyArray extends ReadonlyArray> {} +type DeepReadonlyArray = ReadonlyArray>; type DeepReadonlyObject = { readonly [P in keyof T]: DeepReadonly; diff --git a/extensions/ql-vscode/src/databases/config/db-config-store.ts b/extensions/ql-vscode/src/databases/config/db-config-store.ts index 9d69567da94..b08406c9764 100644 --- a/extensions/ql-vscode/src/databases/config/db-config-store.ts +++ b/extensions/ql-vscode/src/databases/config/db-config-store.ts @@ -298,7 +298,7 @@ export class DbConfigStore extends DisposableObject { let newConfig: DbConfig | undefined = undefined; try { newConfig = await readJSON(this.configPath); - } catch (e) { + } catch { this.configErrors = [ { kind: DbConfigValidationErrorKind.InvalidJson, @@ -332,7 +332,7 @@ export class DbConfigStore extends DisposableObject { let newConfig: DbConfig | undefined = undefined; try { newConfig = readJSONSync(this.configPath); - } catch (e) { + } catch { this.configErrors = [ { kind: DbConfigValidationErrorKind.InvalidJson, diff --git a/extensions/ql-vscode/src/databases/database-fetcher.ts b/extensions/ql-vscode/src/databases/database-fetcher.ts index 9e3c7321304..d6ce79c5e9d 100644 --- a/extensions/ql-vscode/src/databases/database-fetcher.ts +++ b/extensions/ql-vscode/src/databases/database-fetcher.ts @@ -454,7 +454,7 @@ export class DatabaseFetcher { let uri; try { uri = Uri.parse(databaseUrl, true); - } catch (e) { + } catch { throw new Error(`Invalid url: ${databaseUrl}`); } @@ -612,7 +612,7 @@ export class DatabaseFetcher { const obj = JSON.parse(text); msg = obj.error || obj.message || obj.reason || JSON.stringify(obj, null, 2); - } catch (e) { + } catch { msg = text; } throw new Error(`${errorMessage}.\n\nReason: ${msg}`); diff --git a/extensions/ql-vscode/src/databases/local-databases/database-manager.ts b/extensions/ql-vscode/src/databases/local-databases/database-manager.ts index 7b4eb482fbc..f820625a5d8 100644 --- a/extensions/ql-vscode/src/databases/local-databases/database-manager.ts +++ b/extensions/ql-vscode/src/databases/local-databases/database-manager.ts @@ -231,7 +231,7 @@ export class DatabaseManager extends DisposableObject { let originStat; try { originStat = await stat(originDbYml); - } catch (e) { + } catch { // if there is an error here, assume that the origin database // is no longer available. Safely ignore and do not try to re-import. return false; @@ -240,7 +240,7 @@ export class DatabaseManager extends DisposableObject { try { const importedStat = await stat(importedDbYml); return originStat.mtimeMs > importedStat.mtimeMs; - } catch (e) { + } catch { // If either of the files does not exist, we assume the origin is newer. // This shouldn't happen unless the user manually deleted one of the files. return true; diff --git a/extensions/ql-vscode/src/debugger/debug-protocol.ts b/extensions/ql-vscode/src/debugger/debug-protocol.ts index d50bcee2221..44e4fcf3b39 100644 --- a/extensions/ql-vscode/src/debugger/debug-protocol.ts +++ b/extensions/ql-vscode/src/debugger/debug-protocol.ts @@ -96,7 +96,7 @@ export type Response = DebugProtocol.Response & { type: "response" }; export type InitializeResponse = DebugProtocol.InitializeResponse & Response & { command: "initialize" }; -export interface QuickEvalResponse extends Response {} +export type QuickEvalResponse = Response; export type AnyResponse = InitializeResponse | QuickEvalResponse; diff --git a/extensions/ql-vscode/src/language-support/contextual/file-range-from-uri.ts b/extensions/ql-vscode/src/language-support/contextual/file-range-from-uri.ts index 1aeb1fee51e..5274dc32f28 100644 --- a/extensions/ql-vscode/src/language-support/contextual/file-range-from-uri.ts +++ b/extensions/ql-vscode/src/language-support/contextual/file-range-from-uri.ts @@ -31,7 +31,7 @@ export function fileRangeFromURI( return new Location(db.resolveSourceFile(uri.uri), range); } return undefined; - } catch (e) { + } catch { return undefined; } } diff --git a/extensions/ql-vscode/src/language-support/contextual/query-resolver.ts b/extensions/ql-vscode/src/language-support/contextual/query-resolver.ts index 4302b18fa92..4624fa6f383 100644 --- a/extensions/ql-vscode/src/language-support/contextual/query-resolver.ts +++ b/extensions/ql-vscode/src/language-support/contextual/query-resolver.ts @@ -28,7 +28,7 @@ export async function resolveContextualQlPacksForDatabase( ): Promise { try { return await qlpackOfDatabase(cli, databaseItem); - } catch (e) { + } catch { // If we can't find the qlpacks for the database, use the defaults instead } diff --git a/extensions/ql-vscode/src/language-support/language-support.ts b/extensions/ql-vscode/src/language-support/language-support.ts index e73bab07f6b..bded793fdf6 100644 --- a/extensions/ql-vscode/src/language-support/language-support.ts +++ b/extensions/ql-vscode/src/language-support/language-support.ts @@ -12,7 +12,7 @@ import { languages, IndentAction } from "vscode"; * See https://github.com/microsoft/vscode/blob/master/src/vs/editor/test/common/modes/supports/javascriptOnEnterRules.ts */ export function install() { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const langConfig = require("../../language-configuration.json"); // setLanguageConfiguration requires a regexp for the wordpattern, not a string langConfig.wordPattern = new RegExp(langConfig.wordPattern); diff --git a/extensions/ql-vscode/src/model-editor/extensions-workspace-folder.ts b/extensions/ql-vscode/src/model-editor/extensions-workspace-folder.ts index d5606574ab0..f3736748805 100644 --- a/extensions/ql-vscode/src/model-editor/extensions-workspace-folder.ts +++ b/extensions/ql-vscode/src/model-editor/extensions-workspace-folder.ts @@ -133,7 +133,7 @@ async function findGitFolder( const stat = await workspace.fs.stat(gitFolder); // Check whether it's a directory return (stat.type & FileType.Directory) !== 0; - } catch (e) { + } catch { return false; } }), diff --git a/extensions/ql-vscode/src/query-history/query-history-manager.ts b/extensions/ql-vscode/src/query-history/query-history-manager.ts index 22562d76a48..d4b312ad563 100644 --- a/extensions/ql-vscode/src/query-history/query-history-manager.ts +++ b/extensions/ql-vscode/src/query-history/query-history-manager.ts @@ -845,7 +845,7 @@ export class QueryHistoryManager extends DisposableObject { evalLogData, ); this.evalLogViewer.updateRoots(await evalLogTreeBuilder.getRoots()); - } catch (e) { + } catch { throw new Error( `Could not read evaluator log summary JSON file to generate viewer data at ${item.jsonEvalLogSummaryLocation}.`, ); diff --git a/extensions/ql-vscode/src/query-testing/test-runner.ts b/extensions/ql-vscode/src/query-testing/test-runner.ts index 23da9d0c1eb..f0d8aaa39e0 100644 --- a/extensions/ql-vscode/src/query-testing/test-runner.ts +++ b/extensions/ql-vscode/src/query-testing/test-runner.ts @@ -61,7 +61,7 @@ export class TestRunner extends DisposableObject { })) { await eventHandler(event); } - } catch (e) { + } catch { // CodeQL testing can throw exception even in normal scenarios. For example, if the test run // produces no output (which is normal), the testing command would throw an exception on // unexpected EOF during json parsing. So nothing needs to be done here - all the relevant diff --git a/extensions/ql-vscode/src/run-queries-shared.ts b/extensions/ql-vscode/src/run-queries-shared.ts index 4a91cad5e58..6dbaa8e651b 100644 --- a/extensions/ql-vscode/src/run-queries-shared.ts +++ b/extensions/ql-vscode/src/run-queries-shared.ts @@ -607,7 +607,7 @@ export async function logEndSummary( const endSummaryContent = await readFile(endSummary, "utf-8"); void logger.log(" --- Evaluator Log Summary --- "); void logger.log(endSummaryContent); - } catch (e) { + } catch { void showAndLogWarningMessage( extLogger, `Could not read structured evaluator log end of summary file at ${endSummary}.`, diff --git a/extensions/ql-vscode/src/variant-analysis/repo-states-store/repo-states-store.ts b/extensions/ql-vscode/src/variant-analysis/repo-states-store/repo-states-store.ts index f2acb35caf6..647e125821a 100644 --- a/extensions/ql-vscode/src/variant-analysis/repo-states-store/repo-states-store.ts +++ b/extensions/ql-vscode/src/variant-analysis/repo-states-store/repo-states-store.ts @@ -26,7 +26,7 @@ export async function readRepoStates( const repoStates = mapRepoStatesToDomainModel(repoStatesData); return repoStates; - } catch (e) { + } catch { // Ignore this error, we simply might not have downloaded anything yet return undefined; } diff --git a/extensions/ql-vscode/src/variant-analysis/variant-analysis-manager.ts b/extensions/ql-vscode/src/variant-analysis/variant-analysis-manager.ts index 9e05309f41c..d7259a8e3bb 100644 --- a/extensions/ql-vscode/src/variant-analysis/variant-analysis-manager.ts +++ b/extensions/ql-vscode/src/variant-analysis/variant-analysis-manager.ts @@ -562,7 +562,7 @@ export class VariantAnalysisManager }); const doc = await workspace.openTextDocument(uri); await Window.showTextDocument(doc, { preview: false }); - } catch (error) { + } catch { void showAndLogWarningMessage( this.app.logger, "Could not open variant analysis query text. Failed to open text document.", @@ -586,7 +586,7 @@ export class VariantAnalysisManager variantAnalysis.query.filePath, ); await Window.showTextDocument(textDocument, ViewColumn.One); - } catch (error) { + } catch { void showAndLogWarningMessage( this.app.logger, `Could not open file: ${variantAnalysis.query.filePath}`, diff --git a/extensions/ql-vscode/src/view/common/SuggestBox/SuggestBoxItem.tsx b/extensions/ql-vscode/src/view/common/SuggestBox/SuggestBoxItem.tsx index 1693d46f1d2..97a9d1a7486 100644 --- a/extensions/ql-vscode/src/view/common/SuggestBox/SuggestBoxItem.tsx +++ b/extensions/ql-vscode/src/view/common/SuggestBox/SuggestBoxItem.tsx @@ -64,23 +64,35 @@ type Props = { export const SuggestBoxItem = forwardRef< HTMLDivElement, Props & HTMLProps ->(({ children, active, icon, labelText, details, ...props }, ref) => { - const id = useId(); - return ( - - {icon} - - - {details && {details}} - - - ); -}); +>( + ( + { + children, + active, + icon, + labelText, + details, + ...props + }: Props & HTMLProps, + ref, + ) => { + const id = useId(); + return ( + + {icon} + + + {details && {details}} + + + ); + }, +); SuggestBoxItem.displayName = "SuggestBoxItem"; diff --git a/extensions/ql-vscode/src/view/model-editor/MethodRow.tsx b/extensions/ql-vscode/src/view/model-editor/MethodRow.tsx index b0b0c428d08..c098eb353e1 100644 --- a/extensions/ql-vscode/src/view/model-editor/MethodRow.tsx +++ b/extensions/ql-vscode/src/view/model-editor/MethodRow.tsx @@ -116,7 +116,7 @@ export const MethodRow = (props: MethodRowProps) => { }; const ModelableMethodRow = forwardRef( - (props, ref) => { + (props: MethodRowProps, ref) => { const { method, modeledMethods: modeledMethodsProp, @@ -412,7 +412,7 @@ ModelableMethodRow.displayName = "ModelableMethodRow"; const UnmodelableMethodRow = forwardRef< HTMLElement | undefined, MethodRowProps ->((props, ref) => { +>((props: MethodRowProps, ref) => { const { method, viewState, revealedMethodSignature } = props; const jumpToMethod = useCallback( diff --git a/extensions/ql-vscode/src/view/results/ResultTables.tsx b/extensions/ql-vscode/src/view/results/ResultTables.tsx index e84504462ea..3afcb170314 100644 --- a/extensions/ql-vscode/src/view/results/ResultTables.tsx +++ b/extensions/ql-vscode/src/view/results/ResultTables.tsx @@ -124,9 +124,11 @@ export function ResultTables(props: ResultTablesProps) { (evt: MessageEvent): void => { // sanitize origin const origin = evt.origin.replace(/\n|\r/g, ""); - evt.origin === window.origin - ? handleMessage(evt.data as IntoResultsViewMsg) - : console.error(`Invalid event origin ${origin}`); + if (evt.origin === window.origin) { + handleMessage(evt.data as IntoResultsViewMsg); + } else { + console.error(`Invalid event origin ${origin}`); + } }, [handleMessage], ); diff --git a/extensions/ql-vscode/src/view/results/ResultsApp.tsx b/extensions/ql-vscode/src/view/results/ResultsApp.tsx index 394e10df0ad..63f5e060dec 100644 --- a/extensions/ql-vscode/src/view/results/ResultsApp.tsx +++ b/extensions/ql-vscode/src/view/results/ResultsApp.tsx @@ -193,9 +193,11 @@ export function ResultsApp() { (evt: MessageEvent) => { // sanitize origin const origin = evt.origin.replace(/\n|\r/g, ""); - evt.origin === window.origin - ? handleMessage(evt.data as IntoResultsViewMsg) - : console.error(`Invalid event origin ${origin}`); + if (evt.origin === window.origin) { + handleMessage(evt.data as IntoResultsViewMsg); + } else { + console.error(`Invalid event origin ${origin}`); + } }, [handleMessage], ); diff --git a/extensions/ql-vscode/test/common/logging/output-channel-logger.test.ts b/extensions/ql-vscode/test/common/logging/output-channel-logger.test.ts index 0df03c32ea3..ad835dda77e 100644 --- a/extensions/ql-vscode/test/common/logging/output-channel-logger.test.ts +++ b/extensions/ql-vscode/test/common/logging/output-channel-logger.test.ts @@ -50,7 +50,7 @@ describe("OutputChannelLogger tests", function () { tempFolders.storagePath.removeCallback(); }); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const mockOutputChannel = require("vscode").mockOutputChannel; it("should log to the output channel", async () => { diff --git a/extensions/ql-vscode/test/unit-tests/packages/commands/CommandManager.test.ts b/extensions/ql-vscode/test/unit-tests/packages/commands/CommandManager.test.ts index 31dda880376..820855d7ad4 100644 --- a/extensions/ql-vscode/test/unit-tests/packages/commands/CommandManager.test.ts +++ b/extensions/ql-vscode/test/unit-tests/packages/commands/CommandManager.test.ts @@ -15,15 +15,11 @@ describe("CommandManager", () => { }); it("can register typed commands", async () => { - const commands = { - "codeQL.openVariantAnalysisLogs": async (variantAnalysisId: number) => { - return variantAnalysisId * 10; - }, - }; - const commandManager = new CommandManager( - jest.fn(), - jest.fn(), - ); + const commandManager = new CommandManager<{ + "codeQL.openVariantAnalysisLogs": ( + variantAnalysisId: number, + ) => Promise; + }>(jest.fn(), jest.fn()); // @ts-expect-error wrong command name should give a type error commandManager.register("abc", jest.fn()); @@ -81,15 +77,11 @@ describe("CommandManager", () => { }); it("can execute typed commands", async () => { - const commands = { - "codeQL.openVariantAnalysisLogs": async (variantAnalysisId: number) => { - return variantAnalysisId * 10; - }, - }; - const commandManager = new CommandManager( - jest.fn(), - jest.fn(), - ); + const commandManager = new CommandManager<{ + "codeQL.openVariantAnalysisLogs": ( + variantAnalysisId: number, + ) => Promise; + }>(jest.fn(), jest.fn()); // @ts-expect-error wrong command name should give a type error await commandManager.execute("abc", 4); diff --git a/extensions/ql-vscode/test/vscode-tests/cli-integration/queries.test.ts b/extensions/ql-vscode/test/vscode-tests/cli-integration/queries.test.ts index b3bd56a2371..8f3f3216827 100644 --- a/extensions/ql-vscode/test/vscode-tests/cli-integration/queries.test.ts +++ b/extensions/ql-vscode/test/vscode-tests/cli-integration/queries.test.ts @@ -278,7 +278,7 @@ describeWithCodeQL()("Queries", () => { function safeDel(file: string) { try { unlinkSync(file); - } catch (e) { + } catch { // ignore } } diff --git a/extensions/ql-vscode/test/vscode-tests/no-workspace/model-editor/external-api-usage-query.test.ts b/extensions/ql-vscode/test/vscode-tests/no-workspace/model-editor/external-api-usage-query.test.ts index 8bbda315a42..7a4fcd6f531 100644 --- a/extensions/ql-vscode/test/vscode-tests/no-workspace/model-editor/external-api-usage-query.test.ts +++ b/extensions/ql-vscode/test/vscode-tests/no-workspace/model-editor/external-api-usage-query.test.ts @@ -105,7 +105,17 @@ describe("runModelEditorQueries", () => { "/a/b/c/qlpack2.yml", ]), bqrsInfo: jest.fn().mockResolvedValue({ - "result-sets": [], + "result-sets": [ + { + name: "results", + rows: 45, + columns: [], + }, + ], + }), + bqrsDecode: jest.fn().mockResolvedValue({ + tuples: [], + columns: [], }), }), queryRunner: mockedObject({ @@ -140,7 +150,7 @@ describe("runModelEditorQueries", () => { const result = await runModelEditorQueries(Mode.Framework, options); - expect(result).not.toBeUndefined; + expect(result).not.toBeUndefined(); expect(options.cliServer.resolveQlpacks).toHaveBeenCalledTimes(1); expect(options.cliServer.resolveQlpacks).toHaveBeenCalledWith([], true); diff --git a/extensions/ql-vscode/test/vscode-tests/no-workspace/model-editor/suggestion-queries.test.ts b/extensions/ql-vscode/test/vscode-tests/no-workspace/model-editor/suggestion-queries.test.ts index f3ebc013b1f..e5c71658717 100644 --- a/extensions/ql-vscode/test/vscode-tests/no-workspace/model-editor/suggestion-queries.test.ts +++ b/extensions/ql-vscode/test/vscode-tests/no-workspace/model-editor/suggestion-queries.test.ts @@ -200,7 +200,7 @@ describe("runSuggestionsQuery", () => { const result = await runSuggestionsQuery(Mode.Framework, options); - expect(result).not.toBeUndefined; + expect(result).not.toBeUndefined(); expect(options.cliServer.resolveQlpacks).toHaveBeenCalledTimes(1); expect(options.cliServer.resolveQlpacks).toHaveBeenCalledWith([], true); diff --git a/extensions/ql-vscode/test/vscode-tests/no-workspace/query-results.test.ts b/extensions/ql-vscode/test/vscode-tests/no-workspace/query-results.test.ts index b4e27f60fdf..52087898d9a 100644 --- a/extensions/ql-vscode/test/vscode-tests/no-workspace/query-results.test.ts +++ b/extensions/ql-vscode/test/vscode-tests/no-workspace/query-results.test.ts @@ -408,7 +408,7 @@ describe("query-results", () => { function safeDel(file: string) { try { unlinkSync(file); - } catch (e) { + } catch { // ignore } }