From a6f12dd9c0741e37a5b8d9923fda26d601591e44 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 18 Jun 2023 10:36:48 -0400 Subject: [PATCH 01/10] Updated typescript-eslint to v6 beta --- .eslintrc.json | 64 ++-- package-lock.json | 311 ++++++++---------- package.json | 6 +- src/compiler/binder.ts | 4 +- src/compiler/checker.ts | 12 +- src/compiler/program.ts | 2 +- src/harness/fourslashImpl.ts | 4 +- src/server/editorServices.ts | 2 +- .../codefixes/convertToTypeOnlyImport.ts | 2 +- src/services/completions.ts | 2 +- src/services/organizeImports.ts | 2 +- src/services/refactors/convertImport.ts | 4 +- src/services/signatureHelp.ts | 2 +- .../helpers/virtualFileSystemWithWatch.ts | 4 +- src/testRunner/unittests/publicApi.ts | 2 +- 15 files changed, 191 insertions(+), 232 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 5089051839926..a76ebbe7e016e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -10,6 +10,10 @@ "node": true, "es6": true }, + "extends": [ + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/stylistic" + ], "plugins": [ "@typescript-eslint", "no-null", "import", "eslint-plugin-local", "simple-import-sort" ], @@ -25,16 +29,10 @@ "/coverage/**" ], "rules": { + "max-statements-per-line": ["error", { "max": 1 }], "simple-import-sort/imports": "error", "simple-import-sort/exports": "error", - "@typescript-eslint/adjacent-overload-signatures": "error", - "@typescript-eslint/array-type": "error", - "@typescript-eslint/no-array-constructor": "error", - - "brace-style": "off", - "@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }], - "@typescript-eslint/naming-convention": [ "error", { "selector": "typeLike", "format": ["PascalCase"], "filter": { "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", "match": false } }, @@ -48,45 +46,35 @@ { "selector": "property", "format": null } ], - "@typescript-eslint/consistent-type-definitions": ["error", "interface"], - "@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }], - - "max-statements-per-line": ["error", { "max": 1 }], - - "no-duplicate-imports": "off", - "@typescript-eslint/no-duplicate-imports": "error", - - "@typescript-eslint/no-inferrable-types": "error", - "@typescript-eslint/no-misused-new": "error", - "@typescript-eslint/no-this-alias": "error", - - "no-unused-expressions": "off", - "@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }], - - "@typescript-eslint/prefer-for-of": "error", - "@typescript-eslint/prefer-function-type": "error", - "@typescript-eslint/prefer-namespace-keyword": "error", - "@typescript-eslint/prefer-as-const": "error", - - "quotes": "off", + "@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }], + "@typescript-eslint/no-extra-semi": "error", "@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }], - - "semi": "off", "@typescript-eslint/semi": "error", - "@typescript-eslint/no-extra-semi": "error", - - "space-before-function-paren": "off", "@typescript-eslint/space-before-function-paren": ["error", { "asyncArrow": "always", "anonymous": "always", "named": "never" }], - "@typescript-eslint/triple-slash-reference": "error", - "@typescript-eslint/type-annotation-spacing": "error", - "@typescript-eslint/unified-signatures": "error", - - "@typescript-eslint/no-extra-non-null-assertion": "error", + // Todo: do we want these? + "prefer-rest-params": "off", + "prefer-spread": "off", + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-empty-interface": "off", + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/sort-type-constituents": "off", + + // Pending https://github.com/typescript-eslint/typescript-eslint/issues/4820 + "@typescript-eslint/prefer-optional-chain": "off", + + // Rules enabled in typescript-eslint configs that are not applicable here + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/class-literal-property-style": "off", + "@typescript-eslint/consistent-indexed-object-style": "off", + "@typescript-eslint/no-duplicate-enum-values": "off", + "@typescript-eslint/no-namespace": "off", + "@typescript-eslint/no-var-requires": "off", // scripts/eslint/rules "local/object-literal-surrounding-space": "error", diff --git a/package-lock.json b/package-lock.json index e2a7525031aa4..a234644cf6c8f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,9 +25,9 @@ "@types/node": "latest", "@types/source-map-support": "^0.5.6", "@types/which": "^2.0.1", - "@typescript-eslint/eslint-plugin": "^5.33.1", - "@typescript-eslint/parser": "^5.33.1", - "@typescript-eslint/utils": "^5.33.1", + "@typescript-eslint/eslint-plugin": "6.0.0-alpha.158", + "@typescript-eslint/parser": "6.0.0-alpha.158", + "@typescript-eslint/utils": "6.0.0-alpha.158", "azure-devops-node-api": "^12.0.0", "c8": "^7.14.0", "chai": "^4.3.7", @@ -895,32 +895,32 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.11.tgz", - "integrity": "sha512-XxuOfTkCUiOSyBWIvHlUraLw/JT/6Io1365RO6ZuI88STKMavJZPNMU0lFcUTeQXEhHiv64CbxYxBNoDVSmghg==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.0.0-alpha.158.tgz", + "integrity": "sha512-fzcdANIIKtQxen+IdXue1u4EHY8h84M8L+eSSYgQQUxJy7tTN4EfBK4jlAAVxGCE+TkmTzBMe52hMAV0PwNLiQ==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.11", - "@typescript-eslint/type-utils": "5.59.11", - "@typescript-eslint/utils": "5.59.11", + "@eslint-community/regexpp": "^4.5.0", + "@typescript-eslint/scope-manager": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/type-utils": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/utils": "6.0.0-alpha.158+b411706a1", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.0", + "ts-api-utils": "^1.0.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -929,25 +929,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.11.tgz", - "integrity": "sha512-s9ZF3M+Nym6CAZEkJJeO2TFHHDsKAM3ecNkLuH4i4s8/RCPnF5JRip2GyviYkeEAcwGMJxkqG9h2dAsnA1nZpA==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.0.0-alpha.158.tgz", + "integrity": "sha512-LJ7qo0yfk4bxYw2A2OCwUeiGumsU4YCebu29dIxC2lK/aT398KazALqMzPC4z6544OS6zYVM2WI9uyCZ8wgj+Q==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.59.11", - "@typescript-eslint/types": "5.59.11", - "@typescript-eslint/typescript-estree": "5.59.11", + "@typescript-eslint/scope-manager": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/typescript-estree": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/visitor-keys": "6.0.0-alpha.158+b411706a1", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -956,16 +957,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.11.tgz", - "integrity": "sha512-dHFOsxoLFtrIcSj5h0QoBT/89hxQONwmn3FOQ0GOQcLOOXm+MIrS8zEAhs4tWl5MraxCY3ZJpaXQQdFMc2Tu+Q==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.0.0-alpha.158.tgz", + "integrity": "sha512-59HcplMM9ZcdtfVe6pgFzereN49OKeVc/FZsymAaxe9QqGXby665pr2/IHcmFh3cnpgNdRQu+DaD5N538AprjA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.11", - "@typescript-eslint/visitor-keys": "5.59.11" + "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/visitor-keys": "6.0.0-alpha.158+b411706a1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -973,25 +974,25 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.11.tgz", - "integrity": "sha512-LZqVY8hMiVRF2a7/swmkStMYSoXMFlzL6sXV6U/2gL5cwnLWQgLEG8tjWPpaE4rMIdZ6VKWwcffPlo1jPfk43g==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.0.0-alpha.158.tgz", + "integrity": "sha512-fjUFPY92+0RzyRKs185Rpoaw4z4vt5qoxd6kHLLHjqKxO7xNsOF4nPPjRXlKfbVAUHecPqbFBRmElWCuaEjMdg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.59.11", - "@typescript-eslint/utils": "5.59.11", + "@typescript-eslint/typescript-estree": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/utils": "6.0.0-alpha.158+b411706a1", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^1.0.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -1000,12 +1001,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.11.tgz", - "integrity": "sha512-epoN6R6tkvBYSc+cllrz+c2sOFWkbisJZWkOE+y3xHtvYaOE6Wk6B8e114McRJwFRjGvYdJwLXQH5c9osME/AA==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.0.0-alpha.158.tgz", + "integrity": "sha512-xfJnAaGKN1b/cz37T4FtQfCBKwA7fn1qxa/5UZmKT1FwI/J+lybk+dHdhU2KvNGJ/53/vGf0OObUzejf7oByLg==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -1013,21 +1014,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.11.tgz", - "integrity": "sha512-YupOpot5hJO0maupJXixi6l5ETdrITxeo5eBOeuV7RSKgYdU3G5cxO49/9WRnJq9EMrB7AuTSLH/bqOsXi7wPA==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.0.0-alpha.158.tgz", + "integrity": "sha512-1hskAlZ2pliy1DQ1VM3Tu+JUQMtaWaLmMGOOmmI9H7yfudsopV7AOCk+NO1FWIATWIeUvPI33T09WKRdZGO4yg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.11", - "@typescript-eslint/visitor-keys": "5.59.11", + "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/visitor-keys": "6.0.0-alpha.158+b411706a1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "semver": "^7.5.0", + "ts-api-utils": "^1.0.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -1040,42 +1041,42 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.11.tgz", - "integrity": "sha512-didu2rHSOMUdJThLk4aZ1Or8IcO3HzCw/ZvEjTTIfjIrcdd5cvSIwwDy2AOlE7htSNp7QIZ10fLMyRCveesMLg==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.0.0-alpha.158.tgz", + "integrity": "sha512-HDpGNQnbE09Kun4+IjnaWoARmhAdSbR6MTeaA0K12vzCg9M3rL2z72jzP0z4n7bGRJsNAoH+0SKSgcJ9NL8Bhw==", "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", + "@eslint-community/eslint-utils": "^4.3.0", + "@types/json-schema": "^7.0.11", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.11", - "@typescript-eslint/types": "5.59.11", - "@typescript-eslint/typescript-estree": "5.59.11", + "@typescript-eslint/scope-manager": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/typescript-estree": "6.0.0-alpha.158+b411706a1", "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "semver": "^7.5.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.11.tgz", - "integrity": "sha512-KGYniTGG3AMTuKF9QBD7EIrvufkB6O6uX3knP73xbKLMpH+QRPcgnCxjWXSHjMRuOxFLovljqQgQpR0c7GvjoA==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.0.0-alpha.158.tgz", + "integrity": "sha512-/1xiY3B2Du3a8YaKpF3MtNZRlzDRChJAb8kbt4mQ6h3XGLd8ZGRN8l971nbX632p78kETaJ+JgCGtrgJpQZO+g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.11", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -3630,12 +3631,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node_modules/node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", @@ -4454,6 +4449,18 @@ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true }, + "node_modules/ts-api-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.1.tgz", + "integrity": "sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==", + "dev": true, + "engines": { + "node": ">=16.13.0" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/tsconfig-paths": { "version": "3.14.2", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", @@ -4472,27 +4479,6 @@ "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==", "dev": true }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, "node_modules/tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -5390,102 +5376,103 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.11.tgz", - "integrity": "sha512-XxuOfTkCUiOSyBWIvHlUraLw/JT/6Io1365RO6ZuI88STKMavJZPNMU0lFcUTeQXEhHiv64CbxYxBNoDVSmghg==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.0.0-alpha.158.tgz", + "integrity": "sha512-fzcdANIIKtQxen+IdXue1u4EHY8h84M8L+eSSYgQQUxJy7tTN4EfBK4jlAAVxGCE+TkmTzBMe52hMAV0PwNLiQ==", "dev": true, "requires": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.11", - "@typescript-eslint/type-utils": "5.59.11", - "@typescript-eslint/utils": "5.59.11", + "@eslint-community/regexpp": "^4.5.0", + "@typescript-eslint/scope-manager": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/type-utils": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/utils": "6.0.0-alpha.158+b411706a1", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.0", + "ts-api-utils": "^1.0.0" } }, "@typescript-eslint/parser": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.11.tgz", - "integrity": "sha512-s9ZF3M+Nym6CAZEkJJeO2TFHHDsKAM3ecNkLuH4i4s8/RCPnF5JRip2GyviYkeEAcwGMJxkqG9h2dAsnA1nZpA==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.0.0-alpha.158.tgz", + "integrity": "sha512-LJ7qo0yfk4bxYw2A2OCwUeiGumsU4YCebu29dIxC2lK/aT398KazALqMzPC4z6544OS6zYVM2WI9uyCZ8wgj+Q==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.59.11", - "@typescript-eslint/types": "5.59.11", - "@typescript-eslint/typescript-estree": "5.59.11", + "@typescript-eslint/scope-manager": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/typescript-estree": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/visitor-keys": "6.0.0-alpha.158+b411706a1", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.11.tgz", - "integrity": "sha512-dHFOsxoLFtrIcSj5h0QoBT/89hxQONwmn3FOQ0GOQcLOOXm+MIrS8zEAhs4tWl5MraxCY3ZJpaXQQdFMc2Tu+Q==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.0.0-alpha.158.tgz", + "integrity": "sha512-59HcplMM9ZcdtfVe6pgFzereN49OKeVc/FZsymAaxe9QqGXby665pr2/IHcmFh3cnpgNdRQu+DaD5N538AprjA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.11", - "@typescript-eslint/visitor-keys": "5.59.11" + "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/visitor-keys": "6.0.0-alpha.158+b411706a1" } }, "@typescript-eslint/type-utils": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.11.tgz", - "integrity": "sha512-LZqVY8hMiVRF2a7/swmkStMYSoXMFlzL6sXV6U/2gL5cwnLWQgLEG8tjWPpaE4rMIdZ6VKWwcffPlo1jPfk43g==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.0.0-alpha.158.tgz", + "integrity": "sha512-fjUFPY92+0RzyRKs185Rpoaw4z4vt5qoxd6kHLLHjqKxO7xNsOF4nPPjRXlKfbVAUHecPqbFBRmElWCuaEjMdg==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.59.11", - "@typescript-eslint/utils": "5.59.11", + "@typescript-eslint/typescript-estree": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/utils": "6.0.0-alpha.158+b411706a1", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^1.0.0" } }, "@typescript-eslint/types": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.11.tgz", - "integrity": "sha512-epoN6R6tkvBYSc+cllrz+c2sOFWkbisJZWkOE+y3xHtvYaOE6Wk6B8e114McRJwFRjGvYdJwLXQH5c9osME/AA==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.0.0-alpha.158.tgz", + "integrity": "sha512-xfJnAaGKN1b/cz37T4FtQfCBKwA7fn1qxa/5UZmKT1FwI/J+lybk+dHdhU2KvNGJ/53/vGf0OObUzejf7oByLg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.11.tgz", - "integrity": "sha512-YupOpot5hJO0maupJXixi6l5ETdrITxeo5eBOeuV7RSKgYdU3G5cxO49/9WRnJq9EMrB7AuTSLH/bqOsXi7wPA==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.0.0-alpha.158.tgz", + "integrity": "sha512-1hskAlZ2pliy1DQ1VM3Tu+JUQMtaWaLmMGOOmmI9H7yfudsopV7AOCk+NO1FWIATWIeUvPI33T09WKRdZGO4yg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.11", - "@typescript-eslint/visitor-keys": "5.59.11", + "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/visitor-keys": "6.0.0-alpha.158+b411706a1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "semver": "^7.5.0", + "ts-api-utils": "^1.0.0" } }, "@typescript-eslint/utils": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.11.tgz", - "integrity": "sha512-didu2rHSOMUdJThLk4aZ1Or8IcO3HzCw/ZvEjTTIfjIrcdd5cvSIwwDy2AOlE7htSNp7QIZ10fLMyRCveesMLg==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.0.0-alpha.158.tgz", + "integrity": "sha512-HDpGNQnbE09Kun4+IjnaWoARmhAdSbR6MTeaA0K12vzCg9M3rL2z72jzP0z4n7bGRJsNAoH+0SKSgcJ9NL8Bhw==", "dev": true, "requires": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", + "@eslint-community/eslint-utils": "^4.3.0", + "@types/json-schema": "^7.0.11", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.11", - "@typescript-eslint/types": "5.59.11", - "@typescript-eslint/typescript-estree": "5.59.11", + "@typescript-eslint/scope-manager": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/typescript-estree": "6.0.0-alpha.158+b411706a1", "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "semver": "^7.5.0" } }, "@typescript-eslint/visitor-keys": { - "version": "5.59.11", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.11.tgz", - "integrity": "sha512-KGYniTGG3AMTuKF9QBD7EIrvufkB6O6uX3knP73xbKLMpH+QRPcgnCxjWXSHjMRuOxFLovljqQgQpR0c7GvjoA==", + "version": "6.0.0-alpha.158", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.0.0-alpha.158.tgz", + "integrity": "sha512-/1xiY3B2Du3a8YaKpF3MtNZRlzDRChJAb8kbt4mQ6h3XGLd8ZGRN8l971nbX632p78kETaJ+JgCGtrgJpQZO+g==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.11", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", + "eslint-visitor-keys": "^3.4.1" } }, "acorn": { @@ -7371,12 +7358,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", @@ -7926,6 +7907,13 @@ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true }, + "ts-api-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.1.tgz", + "integrity": "sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==", + "dev": true, + "requires": {} + }, "tsconfig-paths": { "version": "3.14.2", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", @@ -7944,23 +7932,6 @@ "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==", "dev": true }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - }, - "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - } - } - }, "tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", diff --git a/package.json b/package.json index 730de63e630fb..64d049c16611c 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,9 @@ "@types/node": "latest", "@types/source-map-support": "^0.5.6", "@types/which": "^2.0.1", - "@typescript-eslint/eslint-plugin": "^5.33.1", - "@typescript-eslint/parser": "^5.33.1", - "@typescript-eslint/utils": "^5.33.1", + "@typescript-eslint/eslint-plugin": "6.0.0-alpha.158", + "@typescript-eslint/parser": "6.0.0-alpha.158", + "@typescript-eslint/utils": "6.0.0-alpha.158", "azure-devops-node-api": "^12.0.0", "c8": "^7.14.0", "chai": "^4.3.7", diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index f54a3e0666f00..ba7d80c46678b 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -3289,7 +3289,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { return; } const rootExpr = getLeftmostAccessExpression(node.left); - if (isIdentifier(rootExpr) && lookupSymbolForName(container, rootExpr.escapedText)?.flags! & SymbolFlags.Alias) { + if (isIdentifier(rootExpr) && lookupSymbolForName(container, rootExpr.escapedText)!.flags & SymbolFlags.Alias) { return; } // Fix up parent pointers since we're going to use these nodes before we bind into them @@ -3322,7 +3322,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { } function bindPotentiallyMissingNamespaces(namespaceSymbol: Symbol | undefined, entityName: BindableStaticNameExpression, isToplevel: boolean, isPrototypeProperty: boolean, containerIsClass: boolean) { - if (namespaceSymbol?.flags! & SymbolFlags.Alias) { + if (namespaceSymbol!.flags & SymbolFlags.Alias) { return namespaceSymbol; } if (isToplevel && !isPrototypeProperty) { diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 59be6353b3a86..ec7daa124c5b5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5732,7 +5732,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return rightMeaning === SymbolFlags.Value ? SymbolFlags.Value : SymbolFlags.Namespace; } - function getAccessibleSymbolChain(symbol: Symbol | undefined, enclosingDeclaration: Node | undefined, meaning: SymbolFlags, useOnlyExternalAliasing: boolean, visitedSymbolTablesMap: Map = new Map()): Symbol[] | undefined { + function getAccessibleSymbolChain(symbol: Symbol | undefined, enclosingDeclaration: Node | undefined, meaning: SymbolFlags, useOnlyExternalAliasing: boolean, visitedSymbolTablesMap = new Map()): Symbol[] | undefined { if (!(symbol && !isPropertyOrMethodDeclarationSymbol(symbol))) { return undefined; } @@ -7165,7 +7165,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function preserveCommentsOn(node: T) { if (some(propertySymbol.declarations, d => d.kind === SyntaxKind.JSDocPropertyTag)) { - const d = propertySymbol.declarations?.find(d => d.kind === SyntaxKind.JSDocPropertyTag)! as JSDocPropertyTag; + const d = propertySymbol.declarations!.find(d => d.kind === SyntaxKind.JSDocPropertyTag) as JSDocPropertyTag; const commentText = getTextOfJSDocComment(d.comment); if (commentText) { setSyntheticLeadingComments(node, [{ kind: SyntaxKind.MultiLineCommentTrivia, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -11616,7 +11616,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function getOuterTypeParametersOfClassOrInterface(symbol: Symbol): TypeParameter[] | undefined { const declaration = (symbol.flags & SymbolFlags.Class || symbol.flags & SymbolFlags.Function) ? symbol.valueDeclaration - : symbol.declarations?.find(decl => { + : symbol.declarations!.find(decl => { if (decl.kind === SyntaxKind.InterfaceDeclaration) { return true; } @@ -11625,7 +11625,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } const initializer = (decl as VariableDeclaration).initializer; return !!initializer && (initializer.kind === SyntaxKind.FunctionExpression || initializer.kind === SyntaxKind.ArrowFunction); - })!; + }); Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -16766,7 +16766,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // Also, unlike union types, the order of the constituent types is preserved in order that overload resolution // for intersections of types with signatures can be deterministic. function getIntersectionType(types: readonly Type[], aliasSymbol?: Symbol, aliasTypeArguments?: readonly Type[], noSupertypeReduction?: boolean): Type { - const typeMembershipMap: Map = new Map(); + const typeMembershipMap = new Map(); const includes = addTypesToIntersection(typeMembershipMap, 0 as TypeFlags, types); const typeSet: Type[] = arrayFrom(typeMembershipMap.values()); // An intersection type is considered empty if it contains @@ -43958,7 +43958,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // so for now we will just not allow them in scripts, which is the only place they can merge cross-file. error(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName); } - if (symbol.declarations?.length! > 1) { + if (symbol.declarations!.length > 1) { const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (firstNonAmbientClassOrFunc) { if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) { diff --git a/src/compiler/program.ts b/src/compiler/program.ts index af9dcdf04c617..2d5b2cc0b6a9a 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1337,7 +1337,7 @@ export function getImpliedNodeFormatForFileWorker( } /** @internal */ -export const plainJSErrors: Set = new Set([ +export const plainJSErrors = new Set([ // binder errors Diagnostics.Cannot_redeclare_block_scoped_variable_0.code, Diagnostics.A_module_cannot_have_multiple_default_exports.code, diff --git a/src/harness/fourslashImpl.ts b/src/harness/fourslashImpl.ts index 681bc8613e49d..c353ab165826d 100644 --- a/src/harness/fourslashImpl.ts +++ b/src/harness/fourslashImpl.ts @@ -774,7 +774,7 @@ export class TestState { const defs = getDefs(); const defIdMap = new Map(); const definitions = defs ? ts.isArray(defs) ? defs : defs.definitions : undefined; - if (definitions?.length! > 1) { + if (definitions!.length > 1) { definitions!.forEach((def, index) => defIdMap.set(def, index)); } let baseline = this.getBaselineForDocumentSpansWithFileContents( @@ -2402,7 +2402,7 @@ export class TestState { q1.marker.fileName === q1.marker.fileName ? (q1.marker.position > q2.marker.position ? -1 : 1) : (q1.marker.fileName > q1.marker.fileName ? 1 : -1)); - const files: Map = new Map(); + const files = new Map(); let previous: T | undefined; for (const { marker, item } of sorted) { const span = (item ? getSpan(item) : undefined) ?? { start: marker.position, length: 1 }; diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 9e38e97d3cf88..3c53534bb7594 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -910,7 +910,7 @@ export class ProjectService { */ readonly openFiles: Map = new Map(); /** @internal */ - readonly configFileForOpenFiles: Map = new Map(); + readonly configFileForOpenFiles = new Map(); /** * Map of open files that are opened without complete path but have projectRoot as current directory */ diff --git a/src/services/codefixes/convertToTypeOnlyImport.ts b/src/services/codefixes/convertToTypeOnlyImport.ts index 6e167fb7313bb..fd5cd3cc2eefc 100644 --- a/src/services/codefixes/convertToTypeOnlyImport.ts +++ b/src/services/codefixes/convertToTypeOnlyImport.ts @@ -61,7 +61,7 @@ registerCodeFix({ }, fixIds: [fixId], getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyImport(context) { - const fixedImportDeclarations: Set = new Set(); + const fixedImportDeclarations = new Set(); return codeFixAll(context, errorCodes, (changes, diag) => { const errorDeclaration = getDeclaration(diag.file, diag.start); if (errorDeclaration?.kind === SyntaxKind.ImportDeclaration && !fixedImportDeclarations.has(errorDeclaration)) { diff --git a/src/services/completions.ts b/src/services/completions.ts index 0becb60309ed2..cd660dd1c00e2 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -4137,7 +4137,7 @@ function getCompletionData( const members = getPropertiesForCompletion(containerExpectedType, typeChecker); const existingMembers = getPropertiesForCompletion(containerActualType, typeChecker); - const existingMemberEscapedNames: Set<__String> = new Set(); + const existingMemberEscapedNames = new Set<__String>(); existingMembers.forEach(s => existingMemberEscapedNames.add(s.escapedName)); symbols = concatenate(symbols, filter(members, s => !existingMemberEscapedNames.has(s.escapedName))); diff --git a/src/services/organizeImports.ts b/src/services/organizeImports.ts index 573f908abf974..c6bf8047ca96c 100644 --- a/src/services/organizeImports.ts +++ b/src/services/organizeImports.ts @@ -647,7 +647,7 @@ function detectSortingWorker(importGroups: ImportDeclaration[][], preferences: U // Check import specifiers const declarationWithNamedImports = find( importGroup, - i => tryCast(i.importClause?.namedBindings, isNamedImports)?.elements.length! > 1); + i => tryCast(i.importClause?.namedBindings, isNamedImports)!.elements.length > 1); if (declarationWithNamedImports) { const namedImportSort = detectImportSpecifierSorting((declarationWithNamedImports.importClause!.namedBindings as NamedImports).elements, preferences); if (namedImportSort) { diff --git a/src/services/refactors/convertImport.ts b/src/services/refactors/convertImport.ts index 2f177be077029..319487ddb1968 100644 --- a/src/services/refactors/convertImport.ts +++ b/src/services/refactors/convertImport.ts @@ -212,7 +212,7 @@ export function doChangeNamedToNamespaceOrDefault(sourceFile: SourceFile, progra const importDecl = toConvert.parent.parent; const { moduleSpecifier } = importDecl; - const toConvertSymbols: Set = new Set(); + const toConvertSymbols = new Set(); toConvert.elements.forEach(namedImport => { const symbol = checker.getSymbolAtLocation(namedImport.name); if (symbol) { @@ -241,7 +241,7 @@ export function doChangeNamedToNamespaceOrDefault(sourceFile: SourceFile, progra // Imports that need to be kept as named imports in the refactored code, to avoid changing the semantics. // More specifically, those are named imports that appear in named exports in the original code, e.g. `a` in `import { a } from "m"; export { a }`. - const neededNamedImports: Set = new Set(); + const neededNamedImports = new Set(); for (const element of toConvert.elements) { const propertyName = (element.propertyName || element.name).text; diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index 9d3c350943987..7b82fb5533b6e 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -743,7 +743,7 @@ function itemInfoForParameters(candidateSignature: Signature, checker: TypeCheck const isVariadic: (parameterList: readonly Symbol[]) => boolean = !checker.hasEffectiveRestParameter(candidateSignature) ? _ => false : lists.length === 1 ? _ => true - : pList => !!(pList.length && tryCast(pList[pList.length - 1], isTransientSymbol)?.links.checkFlags! & CheckFlags.RestParameter); + : pList => !!(pList.length && tryCast(pList[pList.length - 1], isTransientSymbol)!.links.checkFlags & CheckFlags.RestParameter); return lists.map(parameterList => ({ isVariadic: isVariadic(parameterList), parameters: parameterList.map(p => createSignatureHelpParameterForParameter(p, checker, enclosingDeclaration, sourceFile, printer)), diff --git a/src/testRunner/unittests/helpers/virtualFileSystemWithWatch.ts b/src/testRunner/unittests/helpers/virtualFileSystemWithWatch.ts index befe370830e02..5702e3bca76ee 100644 --- a/src/testRunner/unittests/helpers/virtualFileSystemWithWatch.ts +++ b/src/testRunner/unittests/helpers/virtualFileSystemWithWatch.ts @@ -275,7 +275,7 @@ export class TestServerHost implements server.ServerHost, FormatDiagnosticsHost, private readonly output: string[] = []; - private fs: Map = new Map(); + private fs = new Map(); private time = timeIncrements; getCanonicalFileName: (s: string) => string; private toPath: (f: string) => Path; @@ -980,7 +980,7 @@ export class TestServerHost implements server.ServerHost, FormatDiagnosticsHost, } writtenFiles?: Map; - diff(baseline: string[], base: Map = new Map()) { + diff(baseline: string[], base = new Map()) { this.fs.forEach((newFsEntry, path) => { diffFsEntry(baseline, base.get(path), newFsEntry, this.inodes?.get(path), this.writtenFiles); }); diff --git a/src/testRunner/unittests/publicApi.ts b/src/testRunner/unittests/publicApi.ts index a794e71c05352..3afe25d4e9709 100644 --- a/src/testRunner/unittests/publicApi.ts +++ b/src/testRunner/unittests/publicApi.ts @@ -222,7 +222,7 @@ var x const sourceFile = ts.createSourceFile("/file.ts", content, ts.ScriptTarget.ESNext, /*setParentNodes*/ true); const paramTag = sourceFile.getChildren()[0].getChildren()[0].getChildren()[0].getChildren()[0]; const kids = paramTag.getChildren(); - const seen: Set = new Set(); + const seen = new Set(); ts.forEachChild(paramTag, n => { assert.strictEqual(/*actual*/ false, seen.has(n), "Found a duplicate-added child"); seen.add(n); From b0013456bfada65ae8a0435eb069512b058bea22 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 18 Jun 2023 11:41:58 -0400 Subject: [PATCH 02/10] Corrected non-null chains --- .eslintrc.json | 1 + src/compiler/binder.ts | 4 ++-- src/compiler/checker.ts | 8 ++++---- src/harness/fourslashImpl.ts | 2 +- src/services/organizeImports.ts | 2 +- src/services/signatureHelp.ts | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index a76ebbe7e016e..d4fd55fa3b38a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -74,6 +74,7 @@ "@typescript-eslint/consistent-indexed-object-style": "off", "@typescript-eslint/no-duplicate-enum-values": "off", "@typescript-eslint/no-namespace": "off", + "@typescript-eslint/no-non-null-asserted-optional-chain": "off", "@typescript-eslint/no-var-requires": "off", // scripts/eslint/rules diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index ba7d80c46678b..f54a3e0666f00 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -3289,7 +3289,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { return; } const rootExpr = getLeftmostAccessExpression(node.left); - if (isIdentifier(rootExpr) && lookupSymbolForName(container, rootExpr.escapedText)!.flags & SymbolFlags.Alias) { + if (isIdentifier(rootExpr) && lookupSymbolForName(container, rootExpr.escapedText)?.flags! & SymbolFlags.Alias) { return; } // Fix up parent pointers since we're going to use these nodes before we bind into them @@ -3322,7 +3322,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { } function bindPotentiallyMissingNamespaces(namespaceSymbol: Symbol | undefined, entityName: BindableStaticNameExpression, isToplevel: boolean, isPrototypeProperty: boolean, containerIsClass: boolean) { - if (namespaceSymbol!.flags & SymbolFlags.Alias) { + if (namespaceSymbol?.flags! & SymbolFlags.Alias) { return namespaceSymbol; } if (isToplevel && !isPrototypeProperty) { diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ec7daa124c5b5..42e17bf1505bd 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7165,7 +7165,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function preserveCommentsOn(node: T) { if (some(propertySymbol.declarations, d => d.kind === SyntaxKind.JSDocPropertyTag)) { - const d = propertySymbol.declarations!.find(d => d.kind === SyntaxKind.JSDocPropertyTag) as JSDocPropertyTag; + const d = propertySymbol.declarations?.find(d => d.kind === SyntaxKind.JSDocPropertyTag)! as JSDocPropertyTag; const commentText = getTextOfJSDocComment(d.comment); if (commentText) { setSyntheticLeadingComments(node, [{ kind: SyntaxKind.MultiLineCommentTrivia, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -11616,7 +11616,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function getOuterTypeParametersOfClassOrInterface(symbol: Symbol): TypeParameter[] | undefined { const declaration = (symbol.flags & SymbolFlags.Class || symbol.flags & SymbolFlags.Function) ? symbol.valueDeclaration - : symbol.declarations!.find(decl => { + : symbol.declarations?.find(decl => { if (decl.kind === SyntaxKind.InterfaceDeclaration) { return true; } @@ -11625,7 +11625,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } const initializer = (decl as VariableDeclaration).initializer; return !!initializer && (initializer.kind === SyntaxKind.FunctionExpression || initializer.kind === SyntaxKind.ArrowFunction); - }); + })!; Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -43958,7 +43958,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // so for now we will just not allow them in scripts, which is the only place they can merge cross-file. error(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName); } - if (symbol.declarations!.length > 1) { + if (symbol.declarations?.length! > 1) { const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (firstNonAmbientClassOrFunc) { if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) { diff --git a/src/harness/fourslashImpl.ts b/src/harness/fourslashImpl.ts index c353ab165826d..15bd2da47b9ec 100644 --- a/src/harness/fourslashImpl.ts +++ b/src/harness/fourslashImpl.ts @@ -774,7 +774,7 @@ export class TestState { const defs = getDefs(); const defIdMap = new Map(); const definitions = defs ? ts.isArray(defs) ? defs : defs.definitions : undefined; - if (definitions!.length > 1) { + if (definitions?.length! > 1) { definitions!.forEach((def, index) => defIdMap.set(def, index)); } let baseline = this.getBaselineForDocumentSpansWithFileContents( diff --git a/src/services/organizeImports.ts b/src/services/organizeImports.ts index c6bf8047ca96c..573f908abf974 100644 --- a/src/services/organizeImports.ts +++ b/src/services/organizeImports.ts @@ -647,7 +647,7 @@ function detectSortingWorker(importGroups: ImportDeclaration[][], preferences: U // Check import specifiers const declarationWithNamedImports = find( importGroup, - i => tryCast(i.importClause?.namedBindings, isNamedImports)!.elements.length > 1); + i => tryCast(i.importClause?.namedBindings, isNamedImports)?.elements.length! > 1); if (declarationWithNamedImports) { const namedImportSort = detectImportSpecifierSorting((declarationWithNamedImports.importClause!.namedBindings as NamedImports).elements, preferences); if (namedImportSort) { diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index 7b82fb5533b6e..9d3c350943987 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -743,7 +743,7 @@ function itemInfoForParameters(candidateSignature: Signature, checker: TypeCheck const isVariadic: (parameterList: readonly Symbol[]) => boolean = !checker.hasEffectiveRestParameter(candidateSignature) ? _ => false : lists.length === 1 ? _ => true - : pList => !!(pList.length && tryCast(pList[pList.length - 1], isTransientSymbol)!.links.checkFlags & CheckFlags.RestParameter); + : pList => !!(pList.length && tryCast(pList[pList.length - 1], isTransientSymbol)?.links.checkFlags! & CheckFlags.RestParameter); return lists.map(parameterList => ({ isVariadic: isVariadic(parameterList), parameters: parameterList.map(p => createSignatureHelpParameterForParameter(p, checker, enclosingDeclaration, sourceFile, printer)), From 4951fc273b0b16bb7f0cfc6c7352f945e2f602a0 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 18 Jun 2023 11:44:24 -0400 Subject: [PATCH 03/10] Removed unnecessary rule meta.docs.recommended properties --- scripts/eslint/rules/argument-trivia.cjs | 1 - scripts/eslint/rules/debug-assert.cjs | 1 - scripts/eslint/rules/jsdoc-format.cjs | 1 - scripts/eslint/rules/no-double-space.cjs | 1 - scripts/eslint/rules/no-in-operator.cjs | 1 - scripts/eslint/rules/no-keywords.cjs | 1 - scripts/eslint/rules/no-type-assertion-whitespace.cjs | 1 - scripts/eslint/rules/object-literal-surrounding-space.cjs | 1 - scripts/eslint/rules/only-arrow-functions.cjs | 1 - scripts/eslint/rules/simple-indent.cjs | 1 - scripts/eslint/rules/type-operator-spacing.cjs | 1 - 11 files changed, 11 deletions(-) diff --git a/scripts/eslint/rules/argument-trivia.cjs b/scripts/eslint/rules/argument-trivia.cjs index 9b12ba27bcbd1..4ff6b89c9046d 100644 --- a/scripts/eslint/rules/argument-trivia.cjs +++ b/scripts/eslint/rules/argument-trivia.cjs @@ -25,7 +25,6 @@ module.exports = createRule({ meta: { docs: { description: ``, - recommended: "error", }, messages: { argumentTriviaArgumentError: `Tag argument with parameter name`, diff --git a/scripts/eslint/rules/debug-assert.cjs b/scripts/eslint/rules/debug-assert.cjs index da4c70bf4600f..8b2e0b0596a11 100644 --- a/scripts/eslint/rules/debug-assert.cjs +++ b/scripts/eslint/rules/debug-assert.cjs @@ -6,7 +6,6 @@ module.exports = createRule({ meta: { docs: { description: ``, - recommended: "error", }, messages: { secondArgumentDebugAssertError: `Second argument to 'Debug.assert' should be a string literal`, diff --git a/scripts/eslint/rules/jsdoc-format.cjs b/scripts/eslint/rules/jsdoc-format.cjs index d8d78b97970d0..140e22b5e4fd3 100644 --- a/scripts/eslint/rules/jsdoc-format.cjs +++ b/scripts/eslint/rules/jsdoc-format.cjs @@ -6,7 +6,6 @@ module.exports = createRule({ meta: { docs: { description: ``, - recommended: "error", }, messages: { internalCommentInNonJSDocError: `@internal should not appear in non-JSDoc comment for declaration.`, diff --git a/scripts/eslint/rules/no-double-space.cjs b/scripts/eslint/rules/no-double-space.cjs index 1d716d084b08f..75c74d031a4fe 100644 --- a/scripts/eslint/rules/no-double-space.cjs +++ b/scripts/eslint/rules/no-double-space.cjs @@ -6,7 +6,6 @@ module.exports = createRule({ meta: { docs: { description: ``, - recommended: "error", }, messages: { noDoubleSpaceError: `Use only one space`, diff --git a/scripts/eslint/rules/no-in-operator.cjs b/scripts/eslint/rules/no-in-operator.cjs index d17e88be951cf..bbd2b60532596 100644 --- a/scripts/eslint/rules/no-in-operator.cjs +++ b/scripts/eslint/rules/no-in-operator.cjs @@ -6,7 +6,6 @@ module.exports = createRule({ meta: { docs: { description: ``, - recommended: "error", }, messages: { noInOperatorError: `Don't use the 'in' keyword - use 'hasProperty' to check for key presence instead`, diff --git a/scripts/eslint/rules/no-keywords.cjs b/scripts/eslint/rules/no-keywords.cjs index 673a857912cd4..0cb0c9f7b1d4f 100644 --- a/scripts/eslint/rules/no-keywords.cjs +++ b/scripts/eslint/rules/no-keywords.cjs @@ -6,7 +6,6 @@ module.exports = createRule({ meta: { docs: { description: `disallows the use of certain TypeScript keywords as variable or parameter names`, - recommended: "error", }, messages: { noKeywordsError: `{{ name }} clashes with keyword/type`, diff --git a/scripts/eslint/rules/no-type-assertion-whitespace.cjs b/scripts/eslint/rules/no-type-assertion-whitespace.cjs index 174de300562e8..3f10a85dbc7f8 100644 --- a/scripts/eslint/rules/no-type-assertion-whitespace.cjs +++ b/scripts/eslint/rules/no-type-assertion-whitespace.cjs @@ -6,7 +6,6 @@ module.exports = createRule({ meta: { docs: { description: ``, - recommended: "error", }, messages: { noTypeAssertionWhitespace: `Excess trailing whitespace found around type assertion`, diff --git a/scripts/eslint/rules/object-literal-surrounding-space.cjs b/scripts/eslint/rules/object-literal-surrounding-space.cjs index 2321acbce1cf1..b2c8604790170 100644 --- a/scripts/eslint/rules/object-literal-surrounding-space.cjs +++ b/scripts/eslint/rules/object-literal-surrounding-space.cjs @@ -6,7 +6,6 @@ module.exports = createRule({ meta: { docs: { description: ``, - recommended: "error", }, messages: { leadingExcessStringError: `No trailing whitespace found on single-line object literal`, diff --git a/scripts/eslint/rules/only-arrow-functions.cjs b/scripts/eslint/rules/only-arrow-functions.cjs index d2d553ab3b3d6..d68ab8a397a67 100644 --- a/scripts/eslint/rules/only-arrow-functions.cjs +++ b/scripts/eslint/rules/only-arrow-functions.cjs @@ -6,7 +6,6 @@ module.exports = createRule({ meta: { docs: { description: `Disallows traditional (non-arrow) function expressions.`, - recommended: "error", }, messages: { onlyArrowFunctionsError: "non-arrow functions are forbidden", diff --git a/scripts/eslint/rules/simple-indent.cjs b/scripts/eslint/rules/simple-indent.cjs index 3701da068bb84..958e04658ee29 100644 --- a/scripts/eslint/rules/simple-indent.cjs +++ b/scripts/eslint/rules/simple-indent.cjs @@ -6,7 +6,6 @@ module.exports = createRule({ meta: { docs: { description: "Enforce consistent indentation", - recommended: "error", }, messages: { simpleIndentError: "4 space indentation expected", diff --git a/scripts/eslint/rules/type-operator-spacing.cjs b/scripts/eslint/rules/type-operator-spacing.cjs index 16a493eaf0922..5d0fd8f1e9794 100644 --- a/scripts/eslint/rules/type-operator-spacing.cjs +++ b/scripts/eslint/rules/type-operator-spacing.cjs @@ -6,7 +6,6 @@ module.exports = createRule({ meta: { docs: { description: ``, - recommended: "error", }, messages: { typeOperatorSpacingError: `The '|' and '&' operators must be surrounded by spaces`, From f810a223c7b1ee9efd56a6b85041428f4fa467b6 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 18 Jun 2023 17:59:58 -0400 Subject: [PATCH 04/10] Fix build complaint for argument-triva.cjs --- scripts/eslint/rules/argument-trivia.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/eslint/rules/argument-trivia.cjs b/scripts/eslint/rules/argument-trivia.cjs index 4ff6b89c9046d..49ec726dc4b04 100644 --- a/scripts/eslint/rules/argument-trivia.cjs +++ b/scripts/eslint/rules/argument-trivia.cjs @@ -179,7 +179,7 @@ module.exports = createRule({ } const getSignature = memoize(() => { - if (context.parserServices?.hasFullTypeInformation) { + if (context.parserServices?.program) { const parserServices = ESLintUtils.getParserServices(context); const checker = parserServices.program.getTypeChecker(); const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); From 052f6edce6f547b0476138e95d64dad85152315b Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 26 Jun 2023 16:13:01 -0700 Subject: [PATCH 05/10] Updated messaging (comment) for todo rules --- .eslintrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index d4fd55fa3b38a..ce9566cf34b38 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -56,7 +56,7 @@ "named": "never" }], - // Todo: do we want these? + // Todo: enable these soon ✨ "prefer-rest-params": "off", "prefer-spread": "off", "@typescript-eslint/ban-types": "off", From 0fde8d4740918af7f907a37eaeba38b8f49b07bb Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 6 Jul 2023 18:00:19 -0400 Subject: [PATCH 06/10] Bumped to latest alpha --- .eslintrc.json | 2 +- package-lock.json | 170 +++++++++++++++++++++++----------------------- package.json | 6 +- 3 files changed, 89 insertions(+), 89 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index ce9566cf34b38..b8d66d97b9094 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -62,8 +62,8 @@ "@typescript-eslint/ban-types": "off", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-empty-interface": "off", + "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/sort-type-constituents": "off", // Pending https://github.com/typescript-eslint/typescript-eslint/issues/4820 "@typescript-eslint/prefer-optional-chain": "off", diff --git a/package-lock.json b/package-lock.json index 05d6540ac6977..a8f74e90ffa2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,9 +25,9 @@ "@types/node": "latest", "@types/source-map-support": "^0.5.6", "@types/which": "^2.0.1", - "@typescript-eslint/eslint-plugin": "6.0.0-alpha.158", - "@typescript-eslint/parser": "6.0.0-alpha.158", - "@typescript-eslint/utils": "6.0.0-alpha.158", + "@typescript-eslint/eslint-plugin": "6.0.0-alpha.165", + "@typescript-eslint/parser": "6.0.0-alpha.165", + "@typescript-eslint/utils": "6.0.0-alpha.165", "azure-devops-node-api": "^12.0.0", "c8": "^7.14.0", "chai": "^4.3.7", @@ -904,15 +904,15 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.0.0-alpha.158.tgz", - "integrity": "sha512-fzcdANIIKtQxen+IdXue1u4EHY8h84M8L+eSSYgQQUxJy7tTN4EfBK4jlAAVxGCE+TkmTzBMe52hMAV0PwNLiQ==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.0.0-alpha.165.tgz", + "integrity": "sha512-RVaGpz8bXGNCx4bayJWwRIVmegIPgMwFV7GU9679jMQWskrHwvi4v/0njQdwOY1yts6r0dtqaLzoRgUH8sg6KQ==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.0", - "@typescript-eslint/scope-manager": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/type-utils": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/utils": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/scope-manager": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/type-utils": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/utils": "6.0.0-alpha.165+e35c5c1c3", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.4", @@ -938,15 +938,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.0.0-alpha.158.tgz", - "integrity": "sha512-LJ7qo0yfk4bxYw2A2OCwUeiGumsU4YCebu29dIxC2lK/aT398KazALqMzPC4z6544OS6zYVM2WI9uyCZ8wgj+Q==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.0.0-alpha.165.tgz", + "integrity": "sha512-+995Nbdp0LbhydnyMWKEk+F6hCaBK/vaccKDNVvVB9CP+fBZ3p1U9lMaaJkCHN08fCiHP//6wjSqEuQ2tixTXg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/typescript-estree": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/visitor-keys": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/scope-manager": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/typescript-estree": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/visitor-keys": "6.0.0-alpha.165+e35c5c1c3", "debug": "^4.3.4" }, "engines": { @@ -966,13 +966,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.0.0-alpha.158.tgz", - "integrity": "sha512-59HcplMM9ZcdtfVe6pgFzereN49OKeVc/FZsymAaxe9QqGXby665pr2/IHcmFh3cnpgNdRQu+DaD5N538AprjA==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.0.0-alpha.165.tgz", + "integrity": "sha512-HT3sulX3nOkA0t6V9KMNRN5guzBPvgTKkgo7PD/bVbAUS0DYTVKeDxfLM8KzbYXNUyaYY5CBCctfl1ycKhF/mw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/visitor-keys": "6.0.0-alpha.158+b411706a1" + "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/visitor-keys": "6.0.0-alpha.165+e35c5c1c3" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -983,13 +983,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.0.0-alpha.158.tgz", - "integrity": "sha512-fjUFPY92+0RzyRKs185Rpoaw4z4vt5qoxd6kHLLHjqKxO7xNsOF4nPPjRXlKfbVAUHecPqbFBRmElWCuaEjMdg==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.0.0-alpha.165.tgz", + "integrity": "sha512-I3iLlyQzDLF6/xpo+p1GLPFXyB0Wgg5CPJNom1RIzwxmzcU+yZnbOfJ8Vh6Hl27cIjcgYjSYeGtblEtpNFmm+Q==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/utils": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/typescript-estree": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/utils": "6.0.0-alpha.165+e35c5c1c3", "debug": "^4.3.4", "ts-api-utils": "^1.0.0" }, @@ -1010,9 +1010,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.0.0-alpha.158.tgz", - "integrity": "sha512-xfJnAaGKN1b/cz37T4FtQfCBKwA7fn1qxa/5UZmKT1FwI/J+lybk+dHdhU2KvNGJ/53/vGf0OObUzejf7oByLg==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.0.0-alpha.165.tgz", + "integrity": "sha512-8FI0Jb/qkUmoBvCphGVOMtx41Q8ajkr340gdDsUDLzodAqoyX/TZHg2YFk5L3V1m5zEhOSR7z0Bvo3OZxeZT0Q==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1023,13 +1023,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.0.0-alpha.158.tgz", - "integrity": "sha512-1hskAlZ2pliy1DQ1VM3Tu+JUQMtaWaLmMGOOmmI9H7yfudsopV7AOCk+NO1FWIATWIeUvPI33T09WKRdZGO4yg==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.0.0-alpha.165.tgz", + "integrity": "sha512-A0rC4DyGMPnkh10UJqlPCw3vDiC9fNMIrHBDN9W846AJZtIHhE86y/c2y/GkyxlMw8at32+3oYQEhmRoDOz69g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/visitor-keys": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/visitor-keys": "6.0.0-alpha.165+e35c5c1c3", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1050,17 +1050,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.0.0-alpha.158.tgz", - "integrity": "sha512-HDpGNQnbE09Kun4+IjnaWoARmhAdSbR6MTeaA0K12vzCg9M3rL2z72jzP0z4n7bGRJsNAoH+0SKSgcJ9NL8Bhw==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.0.0-alpha.165.tgz", + "integrity": "sha512-3sjsXEJy0DVdtakAar9uitMQhvOCZL3MvirgiJSFSc7awgxJU15H35oy09G7cxkApqnMqYDcZyTDy2tDnLWSEQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.3.0", "@types/json-schema": "^7.0.11", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/typescript-estree": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/scope-manager": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/typescript-estree": "6.0.0-alpha.165+e35c5c1c3", "eslint-scope": "^5.1.1", "semver": "^7.5.0" }, @@ -1076,12 +1076,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.0.0-alpha.158.tgz", - "integrity": "sha512-/1xiY3B2Du3a8YaKpF3MtNZRlzDRChJAb8kbt4mQ6h3XGLd8ZGRN8l971nbX632p78kETaJ+JgCGtrgJpQZO+g==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.0.0-alpha.165.tgz", + "integrity": "sha512-YlG6twkzoEBXYkirKsZ8NWZ9M15u2ezsMYzmpn8NclPWM8KkBn8wxWBglaqkXIBG3byUSIHhWzsKOZkcBKKAuA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -5382,15 +5382,15 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.0.0-alpha.158.tgz", - "integrity": "sha512-fzcdANIIKtQxen+IdXue1u4EHY8h84M8L+eSSYgQQUxJy7tTN4EfBK4jlAAVxGCE+TkmTzBMe52hMAV0PwNLiQ==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.0.0-alpha.165.tgz", + "integrity": "sha512-RVaGpz8bXGNCx4bayJWwRIVmegIPgMwFV7GU9679jMQWskrHwvi4v/0njQdwOY1yts6r0dtqaLzoRgUH8sg6KQ==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.5.0", - "@typescript-eslint/scope-manager": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/type-utils": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/utils": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/scope-manager": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/type-utils": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/utils": "6.0.0-alpha.165+e35c5c1c3", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.4", @@ -5400,54 +5400,54 @@ } }, "@typescript-eslint/parser": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.0.0-alpha.158.tgz", - "integrity": "sha512-LJ7qo0yfk4bxYw2A2OCwUeiGumsU4YCebu29dIxC2lK/aT398KazALqMzPC4z6544OS6zYVM2WI9uyCZ8wgj+Q==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.0.0-alpha.165.tgz", + "integrity": "sha512-+995Nbdp0LbhydnyMWKEk+F6hCaBK/vaccKDNVvVB9CP+fBZ3p1U9lMaaJkCHN08fCiHP//6wjSqEuQ2tixTXg==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/typescript-estree": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/visitor-keys": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/scope-manager": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/typescript-estree": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/visitor-keys": "6.0.0-alpha.165+e35c5c1c3", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.0.0-alpha.158.tgz", - "integrity": "sha512-59HcplMM9ZcdtfVe6pgFzereN49OKeVc/FZsymAaxe9QqGXby665pr2/IHcmFh3cnpgNdRQu+DaD5N538AprjA==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.0.0-alpha.165.tgz", + "integrity": "sha512-HT3sulX3nOkA0t6V9KMNRN5guzBPvgTKkgo7PD/bVbAUS0DYTVKeDxfLM8KzbYXNUyaYY5CBCctfl1ycKhF/mw==", "dev": true, "requires": { - "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/visitor-keys": "6.0.0-alpha.158+b411706a1" + "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/visitor-keys": "6.0.0-alpha.165+e35c5c1c3" } }, "@typescript-eslint/type-utils": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.0.0-alpha.158.tgz", - "integrity": "sha512-fjUFPY92+0RzyRKs185Rpoaw4z4vt5qoxd6kHLLHjqKxO7xNsOF4nPPjRXlKfbVAUHecPqbFBRmElWCuaEjMdg==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.0.0-alpha.165.tgz", + "integrity": "sha512-I3iLlyQzDLF6/xpo+p1GLPFXyB0Wgg5CPJNom1RIzwxmzcU+yZnbOfJ8Vh6Hl27cIjcgYjSYeGtblEtpNFmm+Q==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/utils": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/typescript-estree": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/utils": "6.0.0-alpha.165+e35c5c1c3", "debug": "^4.3.4", "ts-api-utils": "^1.0.0" } }, "@typescript-eslint/types": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.0.0-alpha.158.tgz", - "integrity": "sha512-xfJnAaGKN1b/cz37T4FtQfCBKwA7fn1qxa/5UZmKT1FwI/J+lybk+dHdhU2KvNGJ/53/vGf0OObUzejf7oByLg==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.0.0-alpha.165.tgz", + "integrity": "sha512-8FI0Jb/qkUmoBvCphGVOMtx41Q8ajkr340gdDsUDLzodAqoyX/TZHg2YFk5L3V1m5zEhOSR7z0Bvo3OZxeZT0Q==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.0.0-alpha.158.tgz", - "integrity": "sha512-1hskAlZ2pliy1DQ1VM3Tu+JUQMtaWaLmMGOOmmI9H7yfudsopV7AOCk+NO1FWIATWIeUvPI33T09WKRdZGO4yg==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.0.0-alpha.165.tgz", + "integrity": "sha512-A0rC4DyGMPnkh10UJqlPCw3vDiC9fNMIrHBDN9W846AJZtIHhE86y/c2y/GkyxlMw8at32+3oYQEhmRoDOz69g==", "dev": true, "requires": { - "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/visitor-keys": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/visitor-keys": "6.0.0-alpha.165+e35c5c1c3", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -5456,28 +5456,28 @@ } }, "@typescript-eslint/utils": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.0.0-alpha.158.tgz", - "integrity": "sha512-HDpGNQnbE09Kun4+IjnaWoARmhAdSbR6MTeaA0K12vzCg9M3rL2z72jzP0z4n7bGRJsNAoH+0SKSgcJ9NL8Bhw==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.0.0-alpha.165.tgz", + "integrity": "sha512-3sjsXEJy0DVdtakAar9uitMQhvOCZL3MvirgiJSFSc7awgxJU15H35oy09G7cxkApqnMqYDcZyTDy2tDnLWSEQ==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.3.0", "@types/json-schema": "^7.0.11", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", - "@typescript-eslint/typescript-estree": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/scope-manager": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/typescript-estree": "6.0.0-alpha.165+e35c5c1c3", "eslint-scope": "^5.1.1", "semver": "^7.5.0" } }, "@typescript-eslint/visitor-keys": { - "version": "6.0.0-alpha.158", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.0.0-alpha.158.tgz", - "integrity": "sha512-/1xiY3B2Du3a8YaKpF3MtNZRlzDRChJAb8kbt4mQ6h3XGLd8ZGRN8l971nbX632p78kETaJ+JgCGtrgJpQZO+g==", + "version": "6.0.0-alpha.165", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.0.0-alpha.165.tgz", + "integrity": "sha512-YlG6twkzoEBXYkirKsZ8NWZ9M15u2ezsMYzmpn8NclPWM8KkBn8wxWBglaqkXIBG3byUSIHhWzsKOZkcBKKAuA==", "dev": true, "requires": { - "@typescript-eslint/types": "6.0.0-alpha.158+b411706a1", + "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", "eslint-visitor-keys": "^3.4.1" } }, diff --git a/package.json b/package.json index 64d049c16611c..28ebc83bee2ad 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,9 @@ "@types/node": "latest", "@types/source-map-support": "^0.5.6", "@types/which": "^2.0.1", - "@typescript-eslint/eslint-plugin": "6.0.0-alpha.158", - "@typescript-eslint/parser": "6.0.0-alpha.158", - "@typescript-eslint/utils": "6.0.0-alpha.158", + "@typescript-eslint/eslint-plugin": "6.0.0-alpha.165", + "@typescript-eslint/parser": "6.0.0-alpha.165", + "@typescript-eslint/utils": "6.0.0-alpha.165", "azure-devops-node-api": "^12.0.0", "c8": "^7.14.0", "chai": "^4.3.7", From 2b56c5a290438601498a4234fd79b1d0da95c4fc Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 11 Jul 2023 16:20:38 -0400 Subject: [PATCH 07/10] =?UTF-8?q?typescript-eslint@v6=20stable=20?= =?UTF-8?q?=F0=9F=A5=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 200 +++++++++++++++++++++++++--------------------- package.json | 6 +- 2 files changed, 112 insertions(+), 94 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5de27e1abf6e9..403be38739751 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,9 +25,9 @@ "@types/node": "latest", "@types/source-map-support": "^0.5.6", "@types/which": "^2.0.1", - "@typescript-eslint/eslint-plugin": "6.0.0-alpha.165", - "@typescript-eslint/parser": "6.0.0-alpha.165", - "@typescript-eslint/utils": "6.0.0-alpha.165", + "@typescript-eslint/eslint-plugin": "6.0.0", + "@typescript-eslint/parser": "6.0.0", + "@typescript-eslint/utils": "6.0.0", "azure-devops-node-api": "^12.0.0", "c8": "^7.14.0", "chai": "^4.3.7", @@ -904,21 +904,24 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.0.0-alpha.165.tgz", - "integrity": "sha512-RVaGpz8bXGNCx4bayJWwRIVmegIPgMwFV7GU9679jMQWskrHwvi4v/0njQdwOY1yts6r0dtqaLzoRgUH8sg6KQ==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.0.0.tgz", + "integrity": "sha512-xuv6ghKGoiq856Bww/yVYnXGsKa588kY3M0XK7uUW/3fJNNULKRfZfSBkMTSpqGG/8ZCXCadfh8G/z/B4aqS/A==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.0", - "@typescript-eslint/scope-manager": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/type-utils": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/utils": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/scope-manager": "6.0.0", + "@typescript-eslint/type-utils": "6.0.0", + "@typescript-eslint/utils": "6.0.0", + "@typescript-eslint/visitor-keys": "6.0.0", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", + "graphemer": "^1.4.0", "ignore": "^5.2.4", "natural-compare": "^1.4.0", + "natural-compare-lite": "^1.4.0", "semver": "^7.5.0", - "ts-api-utils": "^1.0.0" + "ts-api-utils": "^1.0.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -938,15 +941,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.0.0-alpha.165.tgz", - "integrity": "sha512-+995Nbdp0LbhydnyMWKEk+F6hCaBK/vaccKDNVvVB9CP+fBZ3p1U9lMaaJkCHN08fCiHP//6wjSqEuQ2tixTXg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.0.0.tgz", + "integrity": "sha512-TNaufYSPrr1U8n+3xN+Yp9g31vQDJqhXzzPSHfQDLcaO4tU+mCfODPxCwf4H530zo7aUBE3QIdxCXamEnG04Tg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/typescript-estree": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/visitor-keys": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/scope-manager": "6.0.0", + "@typescript-eslint/types": "6.0.0", + "@typescript-eslint/typescript-estree": "6.0.0", + "@typescript-eslint/visitor-keys": "6.0.0", "debug": "^4.3.4" }, "engines": { @@ -966,13 +969,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.0.0-alpha.165.tgz", - "integrity": "sha512-HT3sulX3nOkA0t6V9KMNRN5guzBPvgTKkgo7PD/bVbAUS0DYTVKeDxfLM8KzbYXNUyaYY5CBCctfl1ycKhF/mw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.0.0.tgz", + "integrity": "sha512-o4q0KHlgCZTqjuaZ25nw5W57NeykZT9LiMEG4do/ovwvOcPnDO1BI5BQdCsUkjxFyrCL0cSzLjvIMfR9uo7cWg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/visitor-keys": "6.0.0-alpha.165+e35c5c1c3" + "@typescript-eslint/types": "6.0.0", + "@typescript-eslint/visitor-keys": "6.0.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -983,15 +986,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.0.0-alpha.165.tgz", - "integrity": "sha512-I3iLlyQzDLF6/xpo+p1GLPFXyB0Wgg5CPJNom1RIzwxmzcU+yZnbOfJ8Vh6Hl27cIjcgYjSYeGtblEtpNFmm+Q==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.0.0.tgz", + "integrity": "sha512-ah6LJvLgkoZ/pyJ9GAdFkzeuMZ8goV6BH7eC9FPmojrnX9yNCIsfjB+zYcnex28YO3RFvBkV6rMV6WpIqkPvoQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/utils": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/typescript-estree": "6.0.0", + "@typescript-eslint/utils": "6.0.0", "debug": "^4.3.4", - "ts-api-utils": "^1.0.0" + "ts-api-utils": "^1.0.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1010,9 +1013,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.0.0-alpha.165.tgz", - "integrity": "sha512-8FI0Jb/qkUmoBvCphGVOMtx41Q8ajkr340gdDsUDLzodAqoyX/TZHg2YFk5L3V1m5zEhOSR7z0Bvo3OZxeZT0Q==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.0.0.tgz", + "integrity": "sha512-Zk9KDggyZM6tj0AJWYYKgF0yQyrcnievdhG0g5FqyU3Y2DRxJn4yWY21sJC0QKBckbsdKKjYDV2yVrrEvuTgxg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1023,18 +1026,18 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.0.0-alpha.165.tgz", - "integrity": "sha512-A0rC4DyGMPnkh10UJqlPCw3vDiC9fNMIrHBDN9W846AJZtIHhE86y/c2y/GkyxlMw8at32+3oYQEhmRoDOz69g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.0.0.tgz", + "integrity": "sha512-2zq4O7P6YCQADfmJ5OTDQTP3ktajnXIRrYAtHM9ofto/CJZV3QfJ89GEaM2BNGeSr1KgmBuLhEkz5FBkS2RQhQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/visitor-keys": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/types": "6.0.0", + "@typescript-eslint/visitor-keys": "6.0.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", "semver": "^7.5.0", - "ts-api-utils": "^1.0.0" + "ts-api-utils": "^1.0.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1050,17 +1053,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.0.0-alpha.165.tgz", - "integrity": "sha512-3sjsXEJy0DVdtakAar9uitMQhvOCZL3MvirgiJSFSc7awgxJU15H35oy09G7cxkApqnMqYDcZyTDy2tDnLWSEQ==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.0.0.tgz", + "integrity": "sha512-SOr6l4NB6HE4H/ktz0JVVWNXqCJTOo/mHnvIte1ZhBQ0Cvd04x5uKZa3zT6tiodL06zf5xxdK8COiDvPnQ27JQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.3.0", "@types/json-schema": "^7.0.11", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/typescript-estree": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/scope-manager": "6.0.0", + "@typescript-eslint/types": "6.0.0", + "@typescript-eslint/typescript-estree": "6.0.0", "eslint-scope": "^5.1.1", "semver": "^7.5.0" }, @@ -1076,12 +1079,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.0.0-alpha.165.tgz", - "integrity": "sha512-YlG6twkzoEBXYkirKsZ8NWZ9M15u2ezsMYzmpn8NclPWM8KkBn8wxWBglaqkXIBG3byUSIHhWzsKOZkcBKKAuA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.0.0.tgz", + "integrity": "sha512-cvJ63l8c0yXdeT5POHpL0Q1cZoRcmRKFCtSjNGJxPkcP571EfZMcNbzWAc7oK3D1dRzm/V5EwtkANTZxqvuuUA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/types": "6.0.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -3640,6 +3643,12 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "node_modules/node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", @@ -5382,102 +5391,105 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.0.0-alpha.165.tgz", - "integrity": "sha512-RVaGpz8bXGNCx4bayJWwRIVmegIPgMwFV7GU9679jMQWskrHwvi4v/0njQdwOY1yts6r0dtqaLzoRgUH8sg6KQ==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.0.0.tgz", + "integrity": "sha512-xuv6ghKGoiq856Bww/yVYnXGsKa588kY3M0XK7uUW/3fJNNULKRfZfSBkMTSpqGG/8ZCXCadfh8G/z/B4aqS/A==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.5.0", - "@typescript-eslint/scope-manager": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/type-utils": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/utils": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/scope-manager": "6.0.0", + "@typescript-eslint/type-utils": "6.0.0", + "@typescript-eslint/utils": "6.0.0", + "@typescript-eslint/visitor-keys": "6.0.0", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", + "graphemer": "^1.4.0", "ignore": "^5.2.4", "natural-compare": "^1.4.0", + "natural-compare-lite": "^1.4.0", "semver": "^7.5.0", - "ts-api-utils": "^1.0.0" + "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/parser": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.0.0-alpha.165.tgz", - "integrity": "sha512-+995Nbdp0LbhydnyMWKEk+F6hCaBK/vaccKDNVvVB9CP+fBZ3p1U9lMaaJkCHN08fCiHP//6wjSqEuQ2tixTXg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.0.0.tgz", + "integrity": "sha512-TNaufYSPrr1U8n+3xN+Yp9g31vQDJqhXzzPSHfQDLcaO4tU+mCfODPxCwf4H530zo7aUBE3QIdxCXamEnG04Tg==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/typescript-estree": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/visitor-keys": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/scope-manager": "6.0.0", + "@typescript-eslint/types": "6.0.0", + "@typescript-eslint/typescript-estree": "6.0.0", + "@typescript-eslint/visitor-keys": "6.0.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.0.0-alpha.165.tgz", - "integrity": "sha512-HT3sulX3nOkA0t6V9KMNRN5guzBPvgTKkgo7PD/bVbAUS0DYTVKeDxfLM8KzbYXNUyaYY5CBCctfl1ycKhF/mw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.0.0.tgz", + "integrity": "sha512-o4q0KHlgCZTqjuaZ25nw5W57NeykZT9LiMEG4do/ovwvOcPnDO1BI5BQdCsUkjxFyrCL0cSzLjvIMfR9uo7cWg==", "dev": true, "requires": { - "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/visitor-keys": "6.0.0-alpha.165+e35c5c1c3" + "@typescript-eslint/types": "6.0.0", + "@typescript-eslint/visitor-keys": "6.0.0" } }, "@typescript-eslint/type-utils": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.0.0-alpha.165.tgz", - "integrity": "sha512-I3iLlyQzDLF6/xpo+p1GLPFXyB0Wgg5CPJNom1RIzwxmzcU+yZnbOfJ8Vh6Hl27cIjcgYjSYeGtblEtpNFmm+Q==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.0.0.tgz", + "integrity": "sha512-ah6LJvLgkoZ/pyJ9GAdFkzeuMZ8goV6BH7eC9FPmojrnX9yNCIsfjB+zYcnex28YO3RFvBkV6rMV6WpIqkPvoQ==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/utils": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/typescript-estree": "6.0.0", + "@typescript-eslint/utils": "6.0.0", "debug": "^4.3.4", - "ts-api-utils": "^1.0.0" + "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/types": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.0.0-alpha.165.tgz", - "integrity": "sha512-8FI0Jb/qkUmoBvCphGVOMtx41Q8ajkr340gdDsUDLzodAqoyX/TZHg2YFk5L3V1m5zEhOSR7z0Bvo3OZxeZT0Q==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.0.0.tgz", + "integrity": "sha512-Zk9KDggyZM6tj0AJWYYKgF0yQyrcnievdhG0g5FqyU3Y2DRxJn4yWY21sJC0QKBckbsdKKjYDV2yVrrEvuTgxg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.0.0-alpha.165.tgz", - "integrity": "sha512-A0rC4DyGMPnkh10UJqlPCw3vDiC9fNMIrHBDN9W846AJZtIHhE86y/c2y/GkyxlMw8at32+3oYQEhmRoDOz69g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.0.0.tgz", + "integrity": "sha512-2zq4O7P6YCQADfmJ5OTDQTP3ktajnXIRrYAtHM9ofto/CJZV3QfJ89GEaM2BNGeSr1KgmBuLhEkz5FBkS2RQhQ==", "dev": true, "requires": { - "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/visitor-keys": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/types": "6.0.0", + "@typescript-eslint/visitor-keys": "6.0.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", "semver": "^7.5.0", - "ts-api-utils": "^1.0.0" + "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/utils": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.0.0-alpha.165.tgz", - "integrity": "sha512-3sjsXEJy0DVdtakAar9uitMQhvOCZL3MvirgiJSFSc7awgxJU15H35oy09G7cxkApqnMqYDcZyTDy2tDnLWSEQ==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.0.0.tgz", + "integrity": "sha512-SOr6l4NB6HE4H/ktz0JVVWNXqCJTOo/mHnvIte1ZhBQ0Cvd04x5uKZa3zT6tiodL06zf5xxdK8COiDvPnQ27JQ==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.3.0", "@types/json-schema": "^7.0.11", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", - "@typescript-eslint/typescript-estree": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/scope-manager": "6.0.0", + "@typescript-eslint/types": "6.0.0", + "@typescript-eslint/typescript-estree": "6.0.0", "eslint-scope": "^5.1.1", "semver": "^7.5.0" } }, "@typescript-eslint/visitor-keys": { - "version": "6.0.0-alpha.165", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.0.0-alpha.165.tgz", - "integrity": "sha512-YlG6twkzoEBXYkirKsZ8NWZ9M15u2ezsMYzmpn8NclPWM8KkBn8wxWBglaqkXIBG3byUSIHhWzsKOZkcBKKAuA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.0.0.tgz", + "integrity": "sha512-cvJ63l8c0yXdeT5POHpL0Q1cZoRcmRKFCtSjNGJxPkcP571EfZMcNbzWAc7oK3D1dRzm/V5EwtkANTZxqvuuUA==", "dev": true, "requires": { - "@typescript-eslint/types": "6.0.0-alpha.165+e35c5c1c3", + "@typescript-eslint/types": "6.0.0", "eslint-visitor-keys": "^3.4.1" } }, @@ -7364,6 +7376,12 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", diff --git a/package.json b/package.json index 28ebc83bee2ad..6fbf937d05b5e 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,9 @@ "@types/node": "latest", "@types/source-map-support": "^0.5.6", "@types/which": "^2.0.1", - "@typescript-eslint/eslint-plugin": "6.0.0-alpha.165", - "@typescript-eslint/parser": "6.0.0-alpha.165", - "@typescript-eslint/utils": "6.0.0-alpha.165", + "@typescript-eslint/eslint-plugin": "6.0.0", + "@typescript-eslint/parser": "6.0.0", + "@typescript-eslint/utils": "6.0.0", "azure-devops-node-api": "^12.0.0", "c8": "^7.14.0", "chai": "^4.3.7", From 880768ef43be78cc7cc0a2eb00f4f322c177cc28 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 14 Jul 2023 11:21:21 -0400 Subject: [PATCH 08/10] Review feedback: ^versions, eslint:recommended, config phrasing --- .eslintrc.json | 13 +++++++++++-- package-lock.json | 6 +++--- package.json | 6 +++--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index b8d66d97b9094..56d271a3f4021 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,6 +11,7 @@ "es6": true }, "extends": [ + "eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/stylistic" ], @@ -56,10 +57,18 @@ "named": "never" }], - // Todo: enable these soon ✨ + // Todo: For each of these, investigate whether we want to enable them ✨ + "@typescript-eslint/ban-types": "off", + "no-case-declarations": "off", + "no-cond-assign": "off", + "no-constant-condition": "off", + "no-control-regex": "off", + "no-debugger": "off", + "no-extra-boolean-cast": "off", + "no-inner-declarations": "off", + "no-useless-escape": "off", "prefer-rest-params": "off", "prefer-spread": "off", - "@typescript-eslint/ban-types": "off", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-empty-interface": "off", "@typescript-eslint/no-explicit-any": "off", diff --git a/package-lock.json b/package-lock.json index 403be38739751..71d30a5b8c7d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,9 +25,9 @@ "@types/node": "latest", "@types/source-map-support": "^0.5.6", "@types/which": "^2.0.1", - "@typescript-eslint/eslint-plugin": "6.0.0", - "@typescript-eslint/parser": "6.0.0", - "@typescript-eslint/utils": "6.0.0", + "@typescript-eslint/eslint-plugin": "^6.0.0", + "@typescript-eslint/parser": "^6.0.0", + "@typescript-eslint/utils": "^6.0.0", "azure-devops-node-api": "^12.0.0", "c8": "^7.14.0", "chai": "^4.3.7", diff --git a/package.json b/package.json index 6fbf937d05b5e..ec0038cd89683 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,9 @@ "@types/node": "latest", "@types/source-map-support": "^0.5.6", "@types/which": "^2.0.1", - "@typescript-eslint/eslint-plugin": "6.0.0", - "@typescript-eslint/parser": "6.0.0", - "@typescript-eslint/utils": "6.0.0", + "@typescript-eslint/eslint-plugin": "^6.0.0", + "@typescript-eslint/parser": "^6.0.0", + "@typescript-eslint/utils": "^6.0.0", "azure-devops-node-api": "^12.0.0", "c8": "^7.14.0", "chai": "^4.3.7", From 53e2ae18c2ad53917257bc8c478efcbdaf2e67f5 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 14 Jul 2023 14:19:34 -0400 Subject: [PATCH 09/10] A couple more disables --- .eslintrc.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 56d271a3f4021..b2dc542e72ae4 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -109,15 +109,12 @@ "no-null/no-null": "error", // eslint - "constructor-super": "error", "curly": ["error", "multi-line"], "dot-notation": "error", "eqeqeq": "error", "linebreak-style": ["error", "windows"], "new-parens": "error", "no-caller": "error", - "no-duplicate-case": "error", - "no-empty": "error", "no-eval": "error", "no-extra-bind": "error", "no-fallthrough": "error", From 0b726012a07a0b06a085265a6ed56f9571ba50f0 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 14 Jul 2023 14:54:59 -0700 Subject: [PATCH 10/10] Remove last eslint rules in their recommended set --- .eslintrc.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index b2dc542e72ae4..04b8d38793551 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -117,7 +117,6 @@ "no-caller": "error", "no-eval": "error", "no-extra-bind": "error", - "no-fallthrough": "error", "no-new-func": "error", "no-new-wrappers": "error", "no-return-await": "error", @@ -129,24 +128,17 @@ { "name": "setImmediate" }, { "name": "clearImmediate" } ], - "no-sparse-arrays": "error", "no-template-curly-in-string": "error", "no-throw-literal": "error", "no-trailing-spaces": "error", "no-undef-init": "error", - "no-unsafe-finally": "error", - "no-unused-labels": "error", "no-var": "error", "object-shorthand": "error", "prefer-const": "error", "prefer-object-spread": "error", "quote-props": ["error", "consistent-as-needed"], "space-in-parens": "error", - "unicode-bom": ["error", "never"], - "use-isnan": "error", - "no-prototype-builtins": "error", - "no-self-assign": "error", - "no-dupe-else-if": "error" + "unicode-bom": ["error", "never"] }, "overrides": [ // By default, the ESLint CLI only looks at .js files. But, it will also look at