From 03691a27646cd9ce820b96e64b6e3a8d72ca90bb Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 31 Jul 2026 16:15:25 -0400 Subject: [PATCH] Upgrade to eslint 10, enable some linting rules Signed-off-by: David Thompson --- eslint.config.mjs | 4 +- package-lock.json | 542 ++++++++--------------- package.json | 9 +- src/client/tagClosing.ts | 2 +- src/client/xmlClient.ts | 14 +- src/commands/registerCommands.ts | 2 +- src/lsp-commands.ts | 18 +- src/plugin.ts | 4 +- src/server/binary/binaryServerStarter.ts | 22 +- src/server/java/javaServerStarter.ts | 4 +- src/server/serverStarter.ts | 2 +- src/settings/externalXmlSettings.ts | 2 +- src/settings/settings.ts | 7 +- src/telemetry.ts | 2 +- 14 files changed, 226 insertions(+), 408 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 1326e78a..a490284f 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -13,19 +13,19 @@ export default tseslint.config( "dist/**", "server/**", "out/**", + ".vscode-test" ], }, { files: [ "src/**/*" ], rules: { "@typescript-eslint/no-unused-vars": [ - "warn", + "error", { "argsIgnorePattern": "^_", "caughtErrorsIgnorePattern": "^_" } ], - "@typescript-eslint/no-explicit-any": "warn", } }, { files: [ diff --git a/package-lock.json b/package-lock.json index 57fb4d4d..9b1b35e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "yauzl": "^2.10.0" }, "devDependencies": { - "@eslint/js": "^9.16.0", + "@eslint/js": "^10.0.0", "@types/fs-extra": "^8.1.2", "@types/glob": "^7.1.4", "@types/node": "^20.19.9", @@ -27,12 +27,13 @@ "@types/yauzl": "^2.9.1", "@vscode/test-cli": "^0.0.15", "@vscode/test-electron": "^3.1.0", - "eslint": "^9.16.0", - "eslint-webpack-plugin": "^4.2.0", + "eslint": "^10.8.0", + "eslint-webpack-plugin": "^6.0.0", + "globals": "^17.8.0", "gulp": "^5.0.0", "ts-loader": "^9.3.1", "typescript": "^4.9.4", - "typescript-eslint": "^8.16.0", + "typescript-eslint": "^8.65.0", "webpack": "^5.76.0", "webpack-cli": "^4.10.0" }, @@ -95,131 +96,89 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.21.2", + "version": "0.23.5", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", + "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/object-schema": "^2.1.7", + "@eslint/object-schema": "^3.0.5", "debug": "^4.3.1", - "minimatch": "^3.1.5" + "minimatch": "^10.2.4" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/config-array/node_modules/brace-expansion": { - "version": "1.1.15", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@eslint/config-array/node_modules/minimatch": { - "version": "3.1.5", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" + "node": "^20.19.0 || ^22.13.0 || >=24" } }, "node_modules/@eslint/config-helpers": { - "version": "0.4.2", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.7.0.tgz", + "integrity": "sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.17.0" + "@eslint/core": "^1.2.1" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" } }, "node_modules/@eslint/core": { - "version": "0.17.0", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", + "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", "dev": true, "license": "Apache-2.0", "dependencies": { "@types/json-schema": "^7.0.15" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "3.3.5", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^6.14.0", - "debug": "^4.3.2", - "espree": "^10.0.1", - "globals": "^14.0.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.1", - "minimatch": "^3.1.5", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.15", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.5", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" + "node": "^20.19.0 || ^22.13.0 || >=24" } }, "node_modules/@eslint/js": { - "version": "9.39.4", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", "dev": true, "license": "MIT", "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } } }, "node_modules/@eslint/object-schema": { - "version": "2.1.7", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", + "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", "dev": true, "license": "Apache-2.0", "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" } }, "node_modules/@eslint/plugin-kit": { - "version": "0.4.1", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz", + "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.17.0", + "@eslint/core": "^1.2.1", "levn": "^0.4.1" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" } }, "node_modules/@gulpjs/messages": { @@ -381,33 +340,6 @@ "node": ">=8" } }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/types": { - "version": "29.6.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.13", "dev": true, @@ -523,13 +455,10 @@ "node": ">=20" } }, - "node_modules/@sinclair/typebox": { - "version": "0.27.10", - "dev": true, - "license": "MIT" - }, "node_modules/@types/eslint": { - "version": "8.56.12", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", "dev": true, "license": "MIT", "dependencies": { @@ -537,6 +466,13 @@ "@types/json-schema": "*" } }, + "node_modules/@types/esrecurse": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/estree": { "version": "1.0.9", "dev": true, @@ -564,22 +500,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/istanbul-lib-report": { - "version": "3.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/istanbul-lib-coverage": "*" - } - }, - "node_modules/@types/istanbul-reports": { - "version": "3.0.4", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/istanbul-lib-report": "*" - } - }, "node_modules/@types/json-schema": { "version": "7.0.15", "dev": true, @@ -608,19 +528,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/yargs": { - "version": "17.0.35", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@types/yargs-parser": { - "version": "21.0.3", - "dev": true, - "license": "MIT" - }, "node_modules/@types/yauzl": { "version": "2.10.3", "dev": true, @@ -630,15 +537,17 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.61.0", + "version": "8.65.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.65.0.tgz", + "integrity": "sha512-IEgob78X12rHpUmtcwFsXhZdVGJtwTVP8FiCLZkR6GlYVrl2PcuB+KhCE5BlVC/eQpQnu8WXRtkHZuPar+gCRA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.61.0", - "@typescript-eslint/type-utils": "8.61.0", - "@typescript-eslint/utils": "8.61.0", - "@typescript-eslint/visitor-keys": "8.61.0", + "@typescript-eslint/scope-manager": "8.65.0", + "@typescript-eslint/type-utils": "8.65.0", + "@typescript-eslint/utils": "8.65.0", + "@typescript-eslint/visitor-keys": "8.65.0", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" @@ -651,13 +560,15 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.61.0", + "@typescript-eslint/parser": "^8.65.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "7.0.5", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.6.tgz", + "integrity": "sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw==", "dev": true, "license": "MIT", "engines": { @@ -665,14 +576,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.61.0", + "version": "8.65.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.65.0.tgz", + "integrity": "sha512-CZ4nMxWwgu1HEEFNkeaCptra9QCtkmKdgf3sWh1rl1trIhmxLilgTV4cwcbQ4wemnT4sWQN8CaKOmdYx+g2gMA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.61.0", - "@typescript-eslint/types": "8.61.0", - "@typescript-eslint/typescript-estree": "8.61.0", - "@typescript-eslint/visitor-keys": "8.61.0", + "@typescript-eslint/scope-manager": "8.65.0", + "@typescript-eslint/types": "8.65.0", + "@typescript-eslint/typescript-estree": "8.65.0", + "@typescript-eslint/visitor-keys": "8.65.0", "debug": "^4.4.3" }, "engines": { @@ -688,12 +601,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.61.0", + "version": "8.65.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.65.0.tgz", + "integrity": "sha512-SxnPhbTsGahizDgbu7oqFH/xVtzIqMd/s+WtnSxNxJZJpLbdT5IPdzg8EZxO3+PoKahXmwJLeNQOpKJb3/bi7Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.61.0", - "@typescript-eslint/types": "^8.61.0", + "@typescript-eslint/tsconfig-utils": "^8.65.0", + "@typescript-eslint/types": "^8.65.0", "debug": "^4.4.3" }, "engines": { @@ -708,12 +623,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.61.0", + "version": "8.65.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.65.0.tgz", + "integrity": "sha512-Esbl8OSYiVxBokYgWPf7VVWg/BE798wXhimnn9ML9Pt5qoDf8bfQlgjlKXR/k98+AcNzlLKYrpCcrcuZ9DZLgg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.61.0", - "@typescript-eslint/visitor-keys": "8.61.0" + "@typescript-eslint/types": "8.65.0", + "@typescript-eslint/visitor-keys": "8.65.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -724,7 +641,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.61.0", + "version": "8.65.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.65.0.tgz", + "integrity": "sha512-j6GzGqCiRdA7Qhur2VVmKZAkBLfnHFQfx4TaJGL9RMveZqCo48jSHHO0DTgizEnGhtWnqmbtCUSrqSkdiY/0Hg==", "dev": true, "license": "MIT", "engines": { @@ -739,13 +658,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.61.0", + "version": "8.65.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.65.0.tgz", + "integrity": "sha512-YjaZ7PRI5qY7ax2L3PbvX0rRyGtipAReCWs0mhhDBHjH/vl0g0BonaGXrKdKpMbIIsMIwDgbk/xzkBTyAltS5g==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.61.0", - "@typescript-eslint/typescript-estree": "8.61.0", - "@typescript-eslint/utils": "8.61.0", + "@typescript-eslint/types": "8.65.0", + "@typescript-eslint/typescript-estree": "8.65.0", + "@typescript-eslint/utils": "8.65.0", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, @@ -762,7 +683,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.61.0", + "version": "8.65.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.65.0.tgz", + "integrity": "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg==", "dev": true, "license": "MIT", "engines": { @@ -774,14 +697,16 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.61.0", + "version": "8.65.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.65.0.tgz", + "integrity": "sha512-JboAE2swaYt4tb1fHhHTABE2K+OLy09XfcTbhnk4Pw96f9dd2e9iYsJ28gBggHlo5z5x1rkyWvcPoTuNTd4oGg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.61.0", - "@typescript-eslint/tsconfig-utils": "8.61.0", - "@typescript-eslint/types": "8.61.0", - "@typescript-eslint/visitor-keys": "8.61.0", + "@typescript-eslint/project-service": "8.65.0", + "@typescript-eslint/tsconfig-utils": "8.65.0", + "@typescript-eslint/types": "8.65.0", + "@typescript-eslint/visitor-keys": "8.65.0", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", @@ -800,14 +725,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.61.0", + "version": "8.65.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.65.0.tgz", + "integrity": "sha512-gXiwIHsYreboxeJucHKPvgwl7dXt50mF8s1/c00cP/WoVTyWKFdtfhRWwZiXYFU5H2O8vVoSLNrexFZjYS/SGA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.61.0", - "@typescript-eslint/types": "8.61.0", - "@typescript-eslint/typescript-estree": "8.61.0" + "@typescript-eslint/scope-manager": "8.65.0", + "@typescript-eslint/types": "8.65.0", + "@typescript-eslint/typescript-estree": "8.65.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -822,11 +749,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.61.0", + "version": "8.65.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.65.0.tgz", + "integrity": "sha512-8C71BQkGjiMmXtop7pHVJu1l2NNShFdkCyD6a2ezzs5vU/L3LRtb69EtcteFwz0mYMPzIgOw0n6OV4VBUWZd7A==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.61.0", + "@typescript-eslint/types": "8.65.0", "eslint-visitor-keys": "^5.0.0" }, "engines": { @@ -837,17 +766,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "5.0.1", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/@vscode/test-cli": { "version": "0.0.15", "resolved": "https://registry.npmjs.org/@vscode/test-cli/-/test-cli-0.0.15.tgz", @@ -1135,6 +1053,8 @@ }, "node_modules/acorn-jsx": { "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "license": "MIT", "peerDependencies": { @@ -1151,6 +1071,8 @@ }, "node_modules/ajv": { "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, "license": "MIT", "dependencies": { @@ -1585,14 +1507,6 @@ "node": ">=12" } }, - "node_modules/callsites": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -1682,20 +1596,6 @@ "node": ">=6.0" } }, - "node_modules/ci-info": { - "version": "3.9.0", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/cli-cursor": { "version": "5.0.0", "dev": true, @@ -2049,31 +1949,33 @@ } }, "node_modules/eslint": { - "version": "9.39.4", + "version": "10.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.8.0.tgz", + "integrity": "sha512-nuKKvN+oIBO0koN7Tm7dlkmnkc21mtt0QJLwAKzjLq14y6lRTdVG36MZHJ8eQHwdJMwZbQNMlPOYedMq/oVJvQ==", "dev": true, "license": "MIT", + "workspaces": [ + "packages/*" + ], "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", - "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.21.2", - "@eslint/config-helpers": "^0.4.2", - "@eslint/core": "^0.17.0", - "@eslint/eslintrc": "^3.3.5", - "@eslint/js": "9.39.4", - "@eslint/plugin-kit": "^0.4.1", + "@eslint-community/regexpp": "^4.12.2", + "@eslint/config-array": "^0.23.5", + "@eslint/config-helpers": "^0.7.0", + "@eslint/core": "^1.2.1", + "@eslint/plugin-kit": "^0.7.2", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "ajv": "^6.14.0", - "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.4.0", - "eslint-visitor-keys": "^4.2.1", - "espree": "^10.4.0", - "esquery": "^1.5.0", + "eslint-scope": "^9.1.2", + "eslint-visitor-keys": "^5.0.1", + "espree": "^11.2.0", + "esquery": "^1.7.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", @@ -2083,8 +1985,7 @@ "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.5", + "minimatch": "^10.2.5", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, @@ -2092,7 +1993,7 @@ "eslint": "bin/eslint.js" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://eslint.org/donate" @@ -2107,63 +2008,61 @@ } }, "node_modules/eslint-scope": { - "version": "8.4.0", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz", + "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", "dev": true, "license": "BSD-2-Clause", "dependencies": { + "@types/esrecurse": "^4.3.1", + "@types/estree": "^1.0.8", "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-visitor-keys": { - "version": "4.2.1", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", "dev": true, "license": "Apache-2.0", "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-webpack-plugin": { - "version": "4.2.0", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/eslint-webpack-plugin/-/eslint-webpack-plugin-6.0.0.tgz", + "integrity": "sha512-x9m9cH0Rw0RNJB/utP9AMGzmuXg/yLP/FCHSVSfsyjQUyetXN4g1BaIqxkj1i3mVX48aOys0bsVt63LLfh6oYg==", "dev": true, "license": "MIT", "dependencies": { - "@types/eslint": "^8.56.10", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.5", + "@types/eslint": "^9.6.1", + "micromatch": "^4.0.8", "normalize-path": "^3.0.0", - "schema-utils": "^4.2.0" + "schema-utils": "^4.3.3" }, "engines": { - "node": ">= 14.15.0" + "node": ">= 20.9.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" }, "peerDependencies": { - "eslint": "^8.0.0 || ^9.0.0", + "eslint": "^9.0.0 || ^10.0.0", "webpack": "^5.0.0" } }, - "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.15", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/eslint/node_modules/glob-parent": { "version": "6.0.2", "dev": true, @@ -2175,28 +2074,19 @@ "node": ">=10.13.0" } }, - "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.5", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/espree": { - "version": "10.4.0", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", + "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.15.0", + "acorn": "^8.16.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.1" + "eslint-visitor-keys": "^5.0.1" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://opencollective.com/eslint" @@ -2313,6 +2203,8 @@ }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true, "license": "MIT" }, @@ -2361,6 +2253,8 @@ }, "node_modules/fdir": { "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", "dev": true, "license": "MIT", "engines": { @@ -2718,7 +2612,9 @@ } }, "node_modules/globals": { - "version": "14.0.0", + "version": "17.8.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.8.0.tgz", + "integrity": "sha512-Zz/LMDZScFmkakeL2cTHzf+PbWKdpU3uclqkZT7TjDG58j5WPt0PpA+n9uPI24fZtlw07q0OtEi84K+umsRzqQ==", "dev": true, "license": "MIT", "engines": { @@ -2959,6 +2855,8 @@ }, "node_modules/ignore": { "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, "license": "MIT", "engines": { @@ -2970,21 +2868,6 @@ "dev": true, "license": "MIT" }, - "node_modules/import-fresh": { - "version": "3.3.1", - "dev": true, - "license": "MIT", - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/import-local": { "version": "3.2.0", "dev": true, @@ -3318,61 +3201,6 @@ "jdk-utils": "bin/cli.js" } }, - "node_modules/jest-util": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-util/node_modules/picomatch": { - "version": "2.3.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/jest-worker": { - "version": "29.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "8.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, "node_modules/jose": { "version": "5.10.0", "license": "MIT", @@ -3408,6 +3236,8 @@ }, "node_modules/json-schema-traverse": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true, "license": "MIT" }, @@ -3539,11 +3369,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "dev": true, - "license": "MIT" - }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -4235,17 +4060,6 @@ "dev": true, "license": "(MIT AND Zlib)" }, - "node_modules/parent-module": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/parse-filepath": { "version": "1.0.2", "dev": true, @@ -4430,6 +4244,8 @@ }, "node_modules/punycode": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "license": "MIT", "engines": { @@ -4581,14 +4397,6 @@ "node": ">=0.10.0" } }, - "node_modules/resolve-from": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/resolve-options": { "version": "2.0.0", "dev": true, @@ -5181,6 +4989,8 @@ }, "node_modules/tinyglobby": { "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", "dev": true, "license": "MIT", "dependencies": { @@ -5222,6 +5032,8 @@ }, "node_modules/ts-api-utils": { "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", "dev": true, "license": "MIT", "engines": { @@ -5284,14 +5096,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.61.0", + "version": "8.65.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.65.0.tgz", + "integrity": "sha512-/ggrHAwyjENDusvyxbuqxAC2dTnZg/Z8F+fgQtYIz+L6n/9HfSlEZcFGV/NsMNa6CkGk0xUjUAFwC0vHOflvIA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.61.0", - "@typescript-eslint/parser": "8.61.0", - "@typescript-eslint/typescript-estree": "8.61.0", - "@typescript-eslint/utils": "8.61.0" + "@typescript-eslint/eslint-plugin": "8.65.0", + "@typescript-eslint/parser": "8.65.0", + "@typescript-eslint/typescript-estree": "8.65.0", + "@typescript-eslint/utils": "8.65.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5410,6 +5224,8 @@ }, "node_modules/uri-js": { "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { diff --git a/package.json b/package.json index ed824317..2670987b 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "Snippets" ], "devDependencies": { - "@eslint/js": "^9.16.0", + "@eslint/js": "^10.0.0", "@types/fs-extra": "^8.1.2", "@types/glob": "^7.1.4", "@types/node": "^20.19.9", @@ -83,12 +83,13 @@ "@types/yauzl": "^2.9.1", "@vscode/test-cli": "^0.0.15", "@vscode/test-electron": "^3.1.0", - "eslint": "^9.16.0", - "eslint-webpack-plugin": "^4.2.0", + "eslint": "^10.8.0", + "eslint-webpack-plugin": "^6.0.0", + "globals": "^17.8.0", "gulp": "^5.0.0", "ts-loader": "^9.3.1", "typescript": "^4.9.4", - "typescript-eslint": "^8.16.0", + "typescript-eslint": "^8.65.0", "webpack": "^5.76.0", "webpack-cli": "^4.10.0" }, diff --git a/src/client/tagClosing.ts b/src/client/tagClosing.ts index 37f65c11..ad9d5ab7 100644 --- a/src/client/tagClosing.ts +++ b/src/client/tagClosing.ts @@ -78,7 +78,7 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio } } } - }, (_reason: any) => { + }, (_reason: unknown) => { console.log('xml/closeTag request has been cancelled'); }); timeout = void 0; diff --git a/src/client/xmlClient.ts b/src/client/xmlClient.ts index 15da34ea..596a184b 100644 --- a/src/client/xmlClient.ts +++ b/src/client/xmlClient.ts @@ -1,6 +1,6 @@ import { TelemetryEvent } from '@redhat-developer/vscode-redhat-telemetry/lib'; import { commands, ExtensionContext, extensions, Position, TextDocument, TextEditor, Uri, window, workspace } from 'vscode'; -import { Command, ConfigurationParams, ConfigurationRequest, DidChangeConfigurationNotification, DocumentFilter, DocumentSelector, ExecuteCommandParams, LanguageClientOptions, MessageType, NotificationType, RequestType, RevealOutputChannelOn, State, TextDocumentPositionParams } from "vscode-languageclient"; +import { Command, ConfigurationParams, ConfigurationRequest, DidChangeConfigurationNotification, DocumentFilter, ExecuteCommandParams, LanguageClientOptions, MessageType, NotificationType, RequestType, RevealOutputChannelOn, State, TextDocumentPositionParams } from "vscode-languageclient"; import { Executable, LanguageClient } from 'vscode-languageclient/node'; import { XMLFileAssociation } from '../api/xmlExtensionApi'; import { registerClientServerCommands } from '../commands/registerCommands'; @@ -26,14 +26,14 @@ export const XML_SUPPORTED_LANGUAGE_IDS: string[] = XML_SUPPORTED_DOCUMENT_SELEC return l as string; }); -const ExecuteClientCommandRequest: RequestType = new RequestType('xml/executeClientCommand'); +const ExecuteClientCommandRequest: RequestType = new RequestType('xml/executeClientCommand'); -const TagCloseRequest: RequestType = new RequestType('xml/closeTag'); +const TagCloseRequest: RequestType = new RequestType('xml/closeTag'); interface ActionableMessage { severity: MessageType; message: string; - data?: any; + data?: unknown; commands?: Command[]; } @@ -97,7 +97,7 @@ export async function startLanguageClient(context: ExtensionContext, executable: // Copied from: // https://github.com/redhat-developer/vscode-java/pull/1081/files languageClient.onRequest(ConfigurationRequest.type, (params: ConfigurationParams) => { - const result: any[] = []; + const result: unknown[] = []; const activeEditor: TextEditor | undefined = window.activeTextEditor; for (const item of params.items) { if (activeEditor && activeEditor.document.uri.toString() === Uri.parse(item.scopeUri).toString()) { @@ -122,7 +122,7 @@ export async function startLanguageClient(context: ExtensionContext, executable: } })); - const onDidGrantWorkspaceTrust = (workspace as any).onDidGrantWorkspaceTrust; + const onDidGrantWorkspaceTrust = workspace.onDidGrantWorkspaceTrust; if (onDidGrantWorkspaceTrust !== undefined) { context.subscriptions.push(onDidGrantWorkspaceTrust(() => { languageClient.sendNotification(DidChangeConfigurationNotification.type, { settings: getXMLSettings(requirementsData.java_home, logfile, externalXmlSettings) }); @@ -198,7 +198,7 @@ function setupActionableNotificationListener(languageClient: LanguageClient): vo show(notification.message, ...titles).then((selection) => { for (const action of notification.commands) { if (action.title === selection) { - const args: any[] = (action.arguments) ? action.arguments : []; + const args: unknown[] = (action.arguments) ? action.arguments : []; commands.executeCommand(action.command, ...args); break; } diff --git a/src/commands/registerCommands.ts b/src/commands/registerCommands.ts index d75f43b8..4f957675 100644 --- a/src/commands/registerCommands.ts +++ b/src/commands/registerCommands.ts @@ -40,7 +40,7 @@ export async function registerClientServerCommands(context: ExtensionContext, la // Register client command to execute custom XML Language Server command context.subscriptions.push(commands.registerCommand(ClientCommandConstants.EXECUTE_WORKSPACE_COMMAND, (command, ...rest) => { let token: CancellationToken; - let commandArgs: any[] = rest; + let commandArgs: unknown[] = rest; if (rest && rest.length && CancellationToken.is(rest[rest.length - 1])) { token = rest[rest.length - 1]; commandArgs = rest.slice(0, rest.length - 1); diff --git a/src/lsp-commands.ts b/src/lsp-commands.ts index dd5fdf8f..f7620ce1 100644 --- a/src/lsp-commands.ts +++ b/src/lsp-commands.ts @@ -25,28 +25,28 @@ export function registerConfigurationUpdateCommand(): Disposable { return commands.registerCommand(CommandKind.UPDATE_CONFIGURATION, resolveConfigurationItemEdit); } -function resolveConfigurationItemEdit(configurationItemEdit: ConfigurationItemEdit) { +function resolveConfigurationItemEdit(configurationItemEdit: ConfigurationItemEdit) { if (configurationItemEdit.valueKind == ConfigurationItemValueKind.file) { configurationItemEdit.value = resolveFilePath(configurationItemEdit.value); } switch (configurationItemEdit.editType) { case ConfigurationItemEditType.Add: - addToPreferenceArray(configurationItemEdit.section, configurationItemEdit.value); + addToPreferenceArray(configurationItemEdit.section, configurationItemEdit.value); break; case ConfigurationItemEditType.Delete: { - removeFromPreferenceArray(configurationItemEdit.section, configurationItemEdit.value); + removeFromPreferenceArray(configurationItemEdit.section, configurationItemEdit.value); } } } -function resolveFilePath(filePath: any): any { +function resolveFilePath(filePath: string): string { const currentWorkspaceUri = getWorkspaceUri(window.activeTextEditor.document).toString(); return getDirectoryPath(filePath).includes(currentWorkspaceUri) ? getRelativePath(currentWorkspaceUri, filePath) : filePath; } -function addToPreferenceArray(key: string, value: T): void { - const configArray: T[] = workspace.getConfiguration().get(key, []); +function addToPreferenceArray(key: string, value: string): void { + const configArray: string[] = workspace.getConfiguration().get(key, []); if (configArray.includes(value)) { return; } @@ -54,8 +54,8 @@ function addToPreferenceArray(key: string, value: T): void { workspace.getConfiguration().update(key, configArray, ConfigurationTarget.Workspace); } -function removeFromPreferenceArray(key: string, value: T): void { - const configArray: T[] = workspace.getConfiguration().get(key, []); +function removeFromPreferenceArray(key: string, value: string): void { + const configArray: string[] = workspace.getConfiguration().get(key, []); if (!configArray.includes(value)) { return; } @@ -65,7 +65,7 @@ function removeFromPreferenceArray(key: string, value: T): void { interface ConfigurationItemEdit { section: string; - value: any; + value: string; editType: ConfigurationItemEditType; valueKind: ConfigurationItemValueKind; } diff --git a/src/plugin.ts b/src/plugin.ts index e58624ff..0066ff10 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -7,7 +7,7 @@ import * as glob from 'glob'; let existingExtensions: Array; -export function collectXmlJavaExtensions(extensions: readonly vscode.Extension[], jars: string[]): string[] { +export function collectXmlJavaExtensions(extensions: readonly vscode.Extension[], jars: string[]): string[] { const result = []; if (extensions && extensions.length) { for (const extension of extensions) { @@ -30,7 +30,7 @@ export function collectXmlJavaExtensions(extensions: readonly vscode.Extension[], jars: string[]) { +export function onExtensionChange(extensions: readonly vscode.Extension[], jars: string[]) { if (!existingExtensions) { return; } diff --git a/src/server/binary/binaryServerStarter.ts b/src/server/binary/binaryServerStarter.ts index 80e22ce1..c584de54 100644 --- a/src/server/binary/binaryServerStarter.ts +++ b/src/server/binary/binaryServerStarter.ts @@ -5,7 +5,7 @@ import * as https from 'https'; import * as os from 'os'; import * as path from 'path'; import { Readable } from 'stream'; -import { commands, ExtensionContext, extensions, ProgressLocation, ProgressOptions, window, WorkspaceConfiguration } from "vscode"; +import { commands, extensions, ProgressLocation, ProgressOptions, window, WorkspaceConfiguration } from "vscode"; import { Executable } from "vscode-languageclient/node"; import * as yauzl from 'yauzl'; import * as ClientCommandConstants from '../../commands/clientCommandConstants'; @@ -27,7 +27,7 @@ export const ABORTED_ERROR: Error = new Error('XML Language Server download canc * @throws if the binary doesn't exist and can't be downloaded, or if the binary is not trusted * @returns Returns the executable to launch LemMinX (the XML Language Server) as a binary */ -export async function prepareBinaryExecutable(context: ExtensionContext): Promise { +export async function prepareBinaryExecutable(): Promise { const binaryArgs: string = getXMLConfiguration().get("server.binary.args"); let binaryExecutable: Executable; return getServerBinaryPath() @@ -68,7 +68,7 @@ async function getServerBinaryPath(): Promise { // checks read/execute permissions fs.accessSync(binaryPath, fs.constants.R_OK | fs.constants.X_OK) return Promise.resolve(binaryPath); - } catch(e) { + } catch { window.showErrorMessage('Permission(s) denied for the specified XML language server binary. Using the default binary...'); } } else { @@ -134,18 +134,18 @@ async function downloadBinary(): Promise { }); }); downloadPromise.then((_binaryPath) => { - const data: any = {}; + const data: { [x: string]: string } = {}; data[Telemetry.BINARY_DOWNLOAD_STATUS_PROP] = Telemetry.BINARY_DOWNLOAD_SUCCEEDED; Telemetry.sendTelemetry(Telemetry.BINARY_DOWNLOAD_EVT, data); }); downloadPromise.catch(e => { if (e !== ABORTED_ERROR) { - const data: any = {}; + const data: { [x: string]: string } = {}; data[Telemetry.BINARY_DOWNLOAD_STATUS_PROP] = Telemetry.BINARY_DOWNLOAD_FAILED; data['error'] = e.toString(); Telemetry.sendTelemetry(Telemetry.BINARY_DOWNLOAD_EVT, data); } else { - const data: any = {}; + const data: { [x: string]: string } = {}; data[Telemetry.BINARY_DOWNLOAD_STATUS_PROP] = Telemetry.BINARY_DOWNLOAD_ABORTED; Telemetry.sendTelemetry(Telemetry.BINARY_DOWNLOAD_EVT, data); } @@ -188,7 +188,7 @@ async function checkBinaryHash(binaryPath: string): Promise { } return askIfTrustsUnrecognizedBinary(hashDigest, binaryPath); }) - .catch((err: any) => { + .catch((_err) => { return false; }); } @@ -198,7 +198,7 @@ async function checkBinaryHash(binaryPath: string): Promise { * * @returns the environment variables to use to run the server as an object */ -function getBinaryEnvironment(): any { +function getBinaryEnvironment(): { [x: string]: string } { const proxySettings: ProxySettings = getProxySettings(); if (proxySettings) { return { ...process.env, ...getProxySettingsAsEnvironmentVariables(proxySettings) }; @@ -324,7 +324,7 @@ function showProgressForDownload(response: http.IncomingMessage, httpClient: htt resolve(); }); }); - cancelToken.onCancellationRequested((_e: any) => { + cancelToken.onCancellationRequested((_e: unknown) => { httpClient.abort(); }) return downloadFinish; @@ -346,7 +346,7 @@ async function acceptZipDownloadResponse(response: http.IncomingMessage): Promis // Download zip await new Promise((resolve, reject) => { const serverBinaryZipWriteStream: fs.WriteStream = fs.createWriteStream(serverBinaryZipPath); - let capturedError: any = null; + let capturedError = null; serverBinaryZipWriteStream.on('finish', () => { serverBinaryZipWriteStream.close(); }); @@ -368,7 +368,7 @@ async function acceptZipDownloadResponse(response: http.IncomingMessage): Promis // Extract zip return new Promise((resolve, reject)=> { const serverBinaryWriteStream: fs.WriteStream = fs.createWriteStream(serverBinaryPath); - let capturedError: any = null; + let capturedError = null; serverBinaryWriteStream.on('finish', () => { serverBinaryWriteStream.close(); }); diff --git a/src/server/java/javaServerStarter.ts b/src/server/java/javaServerStarter.ts index 81b0f686..3d455e13 100644 --- a/src/server/java/javaServerStarter.ts +++ b/src/server/java/javaServerStarter.ts @@ -104,7 +104,7 @@ function prepareParams(requirements: RequirementsData, xmlJavaExtensions: string } function startedInDebugMode(): boolean { - const args = (process as any).execArgv as string[]; + const args = process.execArgv; return hasDebugFlag(args); } @@ -117,7 +117,7 @@ function hasDebugFlag(args: string[]): boolean { } //exported for tests -export function parseVMargs(params: any[], vmargsLine: string) { +export function parseVMargs(params: string[], vmargsLine: string) { if (!vmargsLine) { return; } diff --git a/src/server/serverStarter.ts b/src/server/serverStarter.ts index 0cfbb9f8..b3a9066a 100644 --- a/src/server/serverStarter.ts +++ b/src/server/serverStarter.ts @@ -48,7 +48,7 @@ export async function prepareExecutable( } if (useBinary) { - return prepareBinaryExecutable(context) + return prepareBinaryExecutable() .catch((e) => { const javaServerMessage = hasJava ? 'Falling back to the Java server.' : 'Cannot start XML language server, since Java is missing.'; if (e === ABORTED_ERROR) { diff --git a/src/settings/externalXmlSettings.ts b/src/settings/externalXmlSettings.ts index 141b7fdf..d265dfff 100644 --- a/src/settings/externalXmlSettings.ts +++ b/src/settings/externalXmlSettings.ts @@ -17,7 +17,7 @@ export class ExternalXmlSettings { return this._xmlCatalogs; } - get xmlFileAssociations(): any[] { + get xmlFileAssociations(): XMLFileAssociation[] { return this._xmlFileAssociations; } diff --git a/src/settings/settings.ts b/src/settings/settings.ts index 17af2600..6b458bce 100644 --- a/src/settings/settings.ts +++ b/src/settings/settings.ts @@ -1,5 +1,6 @@ import * as path from 'path'; import { commands, Extension, extensions, window, workspace, WorkspaceConfiguration } from "vscode"; +import { ExternalXmlSettings } from './externalXmlSettings'; import { getVariableSubstitutedAssociations } from "./variableSubstitution"; export interface ScopeInfo { @@ -65,7 +66,7 @@ export function subscribeJDKChangeConfiguration() { if(params.affectsConfiguration("java")) { const newJavaConfig = getJavaConfiguration(); //don't need to handle reload message if redhat.java extension exists (it will handle it) - const redhatJavaExtension: Extension = extensions.getExtension("redhat.java"); + const redhatJavaExtension: Extension = extensions.getExtension("redhat.java"); const isJavaExtensionActive: boolean = redhatJavaExtension != null && redhatJavaExtension.isActive; if(!isJavaExtensionActive && hasPreferenceChanged(oldJavaConfig, newJavaConfig, "home")) { // checks "java.home" createReloadWindowMessage("`java.home` path has changed. Please restart VS Code."); @@ -188,7 +189,7 @@ export function getJavaagentFlag(vmargs) { * 'xml': {...} * } */ -export function getXMLSettings(javaHome: string | undefined, logfile: string, externalXmlSettings: any): JSON { +export function getXMLSettings(javaHome: string | undefined, logfile: string, externalXmlSettings: ExternalXmlSettings): JSON { const configXML = workspace.getConfiguration().get('xml'); let xml; if (!configXML) { //Set default preferences if not provided @@ -227,7 +228,7 @@ export function getXMLSettings(javaHome: string | undefined, logfile: string, ex }; // Check workspace trust - const isWorkspaceTrusted = (workspace as any).isTrusted; + const isWorkspaceTrusted = workspace.isTrusted; if (isWorkspaceTrusted !== undefined && !isWorkspaceTrusted) { xml['xml']['validation']['resolveExternalEntities'] = false; xml['xml']['downloadExternalResources']['enabled'] = false; diff --git a/src/telemetry.ts b/src/telemetry.ts index e5c1a285..ec2a5b86 100644 --- a/src/telemetry.ts +++ b/src/telemetry.ts @@ -55,7 +55,7 @@ function sendEmptyStartUp() { * @param data the telemetry data * @throws Error if the telemetry service has not been started yet */ -export async function sendTelemetry(eventName: string, data?: any): Promise { +export async function sendTelemetry(eventName: string, data?: unknown): Promise { if (!_telemetryManager) { throw new Error("The telemetry service for vscode-xml has not been started yet"); }