diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 9fbd165..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = { - ignorePatterns: [".tsc", "artifacts", "out", "src/**/*.js", ".eslintrc.js"], - root: true, - parser: "@typescript-eslint/parser", - plugins: ["@typescript-eslint"], - extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], - rules: { - "no-useless-escape": "off", - "prefer-const": "warn", - "@typescript-eslint/no-var-requires": "off", - // https://github.com/typescript-eslint/typescript-eslint/issues/2621 - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": ["warn", { args: "none" }], - }, - env: { - browser: true, - node: true, - }, -}; diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..25ea4f8 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,24 @@ +//@ts-check +/// +const globals = require("globals"); +const eslint = require("@eslint/js"); +const tseslint = require("typescript-eslint"); + +module.exports = tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended, { + // ignores: [".tsc", "artifacts", "out", "node_modules", "eslint.config.js"], + rules: { + "no-useless-escape": "off", + "prefer-const": "warn", + "@typescript-eslint/no-var-requires": "off", + // https://github.com/typescript-eslint/typescript-eslint/issues/2621 + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": ["warn", { args: "none" }], + }, + languageOptions: { + globals: { + ...globals.browser, + ...globals.node, + ...globals.commonjs, + }, + }, +}); diff --git a/package.json b/package.json index 64b974b..b30bc1a 100644 --- a/package.json +++ b/package.json @@ -234,10 +234,10 @@ "webpack-cli": "^5" }, "optionalDependencies": { - "@typescript-eslint/eslint-plugin": "^7", - "@typescript-eslint/parser": "^7", + "@eslint/js": "^9.1.1", "@vscode/vsce": "^2.24.0", - "eslint": "^9" + "eslint": "^9.1.1", + "typescript-eslint": "^7.7.1" }, "repository": { "type": "git", diff --git a/src/syntax/common/tmLanguage-repo.ts b/src/syntax/common/tmLanguage-repo.ts index 7454e4b..c840d52 100644 --- a/src/syntax/common/tmLanguage-repo.ts +++ b/src/syntax/common/tmLanguage-repo.ts @@ -9,9 +9,9 @@ export class RepositoryManager { readonly usage: { [name in RepositoryNames]: number }; constructor() { - const usage: any = {}; + const usage: { [name in RepositoryNames]?: number } = {}; for (const name of Object.keys(this.repo)) usage[name] = 0; - this.usage = usage; + this.usage = usage as typeof this.usage; } /** diff --git a/yarn.lock b/yarn.lock index b2f8b4d..8bc1b27 100644 --- a/yarn.lock +++ b/yarn.lock @@ -147,7 +147,7 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@9.1.1": +"@eslint/js@9.1.1", "@eslint/js@^9.1.1": version "9.1.1" resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.1.1.tgz#eb0f82461d12779bbafc1b5045cde3143d350a8a" integrity sha512-5WoDz3Y19Bg2BnErkZTp0en+c/i9PvgFS7MBe1+m60HjFr0hrphlAGp4yzI7pxpt4xShln4ZyYp4neJm8hmOkQ== @@ -458,7 +458,7 @@ resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.88.0.tgz#2dc690237f7ef049942508c8609b6b9f5216b4d3" integrity sha512-rWY+Bs6j/f1lvr8jqZTyp5arRMfovdxolcqGi+//+cPDOh8SBvzXH90e7BiSXct5HJ9HGW6jATchbRTpTJpEkw== -"@typescript-eslint/eslint-plugin@^7": +"@typescript-eslint/eslint-plugin@7.7.1": version "7.7.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.7.1.tgz#50a9044e3e5fe76b22caf64fb7fc1f97614bdbfd" integrity sha512-KwfdWXJBOviaBVhxO3p5TJiLpNuh2iyXyjmWN0f1nU87pwyvfS0EmjC6ukQVYVFJd/K1+0NWGPDXiyEyQorn0Q== @@ -475,7 +475,7 @@ semver "^7.6.0" ts-api-utils "^1.3.0" -"@typescript-eslint/parser@^7": +"@typescript-eslint/parser@7.7.1": version "7.7.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.7.1.tgz#f940e9f291cdca40c46cb75916217d3a42d6ceea" integrity sha512-vmPzBOOtz48F6JAGVS/kZYk4EkXao6iGrD838sp1w3NQQC0W8ry/q641KU4PrG7AKNAf56NOcR8GOpH8l9FPCw== @@ -1389,7 +1389,7 @@ eslint-visitor-keys@^4.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz#e3adc021aa038a2a8e0b2f8b0ce8f66b9483b1fb" integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw== -eslint@^9: +eslint@^9.1.1: version "9.1.1" resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.1.1.tgz#39ec657ccd12813cb4a1dab2f9229dcc6e468271" integrity sha512-b4cRQ0BeZcSEzPpY2PjFY70VbO32K7BStTGtBsnIGdTSEEQzBi8hPBcGQmTG2zUvFr9uLe0TK42bw8YszuHEqg== @@ -3318,6 +3318,15 @@ typed-rest-client@^1.8.4: tunnel "0.0.6" underscore "^1.12.1" +typescript-eslint@^7.7.1: + version "7.7.1" + resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-7.7.1.tgz#16f82e83bb0955af02f258cb7a9de59e1bfb8706" + integrity sha512-ykEBfa3xx3odjZy6GRED4SCPrjo0rgHwstLlEgLX4EMEuv7QeIDSmfV+S6Kk+XkbsYn4BDEcPvsci1X26lRpMQ== + dependencies: + "@typescript-eslint/eslint-plugin" "7.7.1" + "@typescript-eslint/parser" "7.7.1" + "@typescript-eslint/utils" "7.7.1" + typescript@^5: version "5.4.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611"