Update dependencies to support TypeScript 4.7 (#12921)
* Update `@typescript-eslint/typescript-estree` to 5.26.0 * Update `typescript` to `4.7.1-rc` * Fix syntax kind * Add `jsdoc_only_types.ts` to unstable tests * Make printing jsdoc type stable * Update typescript
This commit is contained in:
1 parent
5b113e71b1
commit
3147244f55
6 files changed
+62
-17
No files matched your search
+2
-2
@@ -27,7 +27,7 @@
|
||||
"@babel/parser": "7.18.0",
|
||||
"@glimmer/syntax": "0.84.2",
|
||||
"@iarna/toml": "2.2.5",
|
||||
"@typescript-eslint/typescript-estree": "5.20.0",
|
||||
"@typescript-eslint/typescript-estree": "5.26.0",
|
||||
"acorn": "8.7.0",
|
||||
"acorn-jsx": "5.3.2",
|
||||
"angular-estree-parser": "2.5.0",
|
||||
@@ -82,7 +82,7 @@
|
||||
"semver": "7.3.7",
|
||||
"string-width": "5.0.1",
|
||||
"strip-ansi": "7.0.1",
|
||||
"typescript": "4.6.3",
|
||||
"typescript": "4.7.2",
|
||||
"unicode-regex": "3.0.0",
|
||||
"unified": "9.2.1",
|
||||
"vnopts": "1.0.2",
|
||||
|
||||
@@ -41,7 +41,7 @@ function throwErrorForInvalidDecorator(
|
||||
// Values of abstract property is removed since `@typescript-eslint/typescript-estree` v5
|
||||
// https://github.com/typescript-eslint/typescript-eslint/releases/tag/v5.0.0
|
||||
function throwErrorForInvalidAbstractProperty(tsNode, esTreeNode) {
|
||||
const SYNTAX_KIND_PROPERTY_DEFINITION = 166;
|
||||
const SYNTAX_KIND_PROPERTY_DEFINITION = 167;
|
||||
const SYNTAX_KIND_ABSTRACT_KEYWORD = 126;
|
||||
if (
|
||||
tsNode.kind !== SYNTAX_KIND_PROPERTY_DEFINITION ||
|
||||
|
||||
@@ -311,6 +311,16 @@ function printIndexedAccessType(path, options, print) {
|
||||
return [print("objectType"), leftDelimiter, print("indexType"), "]"];
|
||||
}
|
||||
|
||||
// `TSJSDocNullableType`, `TSJSDocNonNullableType`
|
||||
function printJSDocType(path, print, token) {
|
||||
const node = path.getValue();
|
||||
return [
|
||||
node.postfix ? "" : token,
|
||||
print("typeAnnotation"),
|
||||
node.postfix ? token : "",
|
||||
];
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
printOpaqueType,
|
||||
printTypeAlias,
|
||||
@@ -320,4 +330,5 @@ module.exports = {
|
||||
printTupleType,
|
||||
printIndexedAccessType,
|
||||
shouldHugType,
|
||||
printJSDocType,
|
||||
};
|
||||
@@ -49,6 +49,7 @@ const {
|
||||
printFunctionType,
|
||||
printTupleType,
|
||||
printIndexedAccessType,
|
||||
printJSDocType,
|
||||
} = require("./type-annotation.js");
|
||||
|
||||
function printTypescript(path, options, print) {
|
||||
@@ -517,9 +518,9 @@ function printTypescript(path, options, print) {
|
||||
case "TSJSDocUnknownType":
|
||||
return "?";
|
||||
case "TSJSDocNullableType":
|
||||
return ["?", print("typeAnnotation")];
|
||||
return printJSDocType(path, print, /* token */ "?");
|
||||
case "TSJSDocNonNullableType":
|
||||
return ["!", print("typeAnnotation")];
|
||||
return printJSDocType(path, print, /* token */ "!");
|
||||
case "TSInstantiationExpression":
|
||||
return [print("expression"), print("typeParameters")];
|
||||
default:
|
||||
|
||||
@@ -411,10 +411,10 @@ let h: !(string | number);
|
||||
let a: *;
|
||||
function b(x: ?) {}
|
||||
let c: ?string;
|
||||
let d: ?string;
|
||||
let d: string?;
|
||||
let e: ?(string | number);
|
||||
let f: !string;
|
||||
let g: !string;
|
||||
let g: string!;
|
||||
let h: !(string | number);
|
||||
|
||||
================================================================================
|
||||
@@ -449,10 +449,10 @@ let h: !(string | number);
|
||||
let a: *;
|
||||
function b(x: ?) {}
|
||||
let c: ?string;
|
||||
let d: ?string;
|
||||
let d: string?;
|
||||
let e: ?(string | number);
|
||||
let f: !string;
|
||||
let g: !string;
|
||||
let g: string!;
|
||||
let h: !(string | number);
|
||||
|
||||
================================================================================
|
||||
@@ -477,10 +477,10 @@ let h: !(string | number);
|
||||
let a: *;
|
||||
function b(x: ?) {}
|
||||
let c: ?string;
|
||||
let d: ?string;
|
||||
let d: string?;
|
||||
let e: ?(string | number);
|
||||
let f: !string;
|
||||
let g: !string;
|
||||
let g: string!;
|
||||
let h: !(string | number);
|
||||
|
||||
================================================================================
|
||||
|
||||
@@ -1761,6 +1761,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.20.0.tgz#fa39c3c2aa786568302318f1cb51fcf64258c20c"
|
||||
integrity sha512-+d8wprF9GyvPwtoB4CxBAR/s0rpP25XKgnOvMf/gMXYDvlUC3rPFHupdTQ/ow9vn7UDe5rX02ovGYQbv/IUCbg==
|
||||
|
||||
"@typescript-eslint/types@5.26.0":
|
||||
version "5.26.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.26.0.tgz#cb204bb154d3c103d9cc4d225f311b08219469f3"
|
||||
integrity sha512-8794JZFE1RN4XaExLWLI2oSXsVImNkl79PzTOOWt9h0UHROwJedNOD2IJyfL0NbddFllcktGIO2aOu10avQQyA==
|
||||
|
||||
"@typescript-eslint/typescript-estree@5.20.0":
|
||||
version "5.20.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.20.0.tgz#ab73686ab18c8781bbf249c9459a55dc9417d6b0"
|
||||
@@ -1774,6 +1779,19 @@
|
||||
semver "^7.3.5"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/typescript-estree@5.26.0":
|
||||
version "5.26.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.26.0.tgz#16cbceedb0011c2ed4f607255f3ee1e6e43b88c3"
|
||||
integrity sha512-EyGpw6eQDsfD6jIqmXP3rU5oHScZ51tL/cZgFbFBvWuCwrIptl+oueUZzSmLtxFuSOQ9vDcJIs+279gnJkfd1w==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.26.0"
|
||||
"@typescript-eslint/visitor-keys" "5.26.0"
|
||||
debug "^4.3.4"
|
||||
globby "^11.1.0"
|
||||
is-glob "^4.0.3"
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/utils@5.20.0", "@typescript-eslint/utils@^5.10.0":
|
||||
version "5.20.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.20.0.tgz#b8e959ed11eca1b2d5414e12417fd94cae3517a5"
|
||||
@@ -1794,6 +1812,14 @@
|
||||
"@typescript-eslint/types" "5.20.0"
|
||||
eslint-visitor-keys "^3.0.0"
|
||||
|
||||
"@typescript-eslint/visitor-keys@5.26.0":
|
||||
version "5.26.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.26.0.tgz#7195f756e367f789c0e83035297c45b417b57f57"
|
||||
integrity sha512-wei+ffqHanYDOQgg/fS6Hcar6wAWv0CUPQ3TZzOWd2BLfgP539rb49bwua8WRAs7R6kOSLn82rfEu2ro6Llt8Q==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.26.0"
|
||||
eslint-visitor-keys "^3.3.0"
|
||||
|
||||
abab@^2.0.3, abab@^2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a"
|
||||
@@ -2597,6 +2623,13 @@ debug@^3.2.7:
|
||||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
debug@^4.3.4:
|
||||
version "4.3.4"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
|
||||
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
|
||||
dependencies:
|
||||
ms "2.1.2"
|
||||
|
||||
decimal.js@^10.2.1:
|
||||
version "10.3.1"
|
||||
resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783"
|
||||
@@ -3536,7 +3569,7 @@ globals@^13.6.0, globals@^13.9.0:
|
||||
dependencies:
|
||||
type-fest "^0.20.2"
|
||||
|
||||
globby@^11.0.1, globby@^11.0.4:
|
||||
globby@^11.0.1, globby@^11.0.4, globby@^11.1.0:
|
||||
version "11.1.0"
|
||||
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
|
||||
integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==
|
||||
@@ -5835,7 +5868,7 @@ semver@7.3.5:
|
||||
dependencies:
|
||||
lru-cache "^6.0.0"
|
||||
|
||||
semver@7.3.7, semver@^7.3.2, semver@^7.3.5, semver@^7.3.6:
|
||||
semver@7.3.7, semver@^7.3.2, semver@^7.3.5, semver@^7.3.6, semver@^7.3.7:
|
||||
version "7.3.7"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f"
|
||||
integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==
|
||||
@@ -6371,10 +6404,10 @@ typedarray-to-buffer@^3.1.5:
|
||||
dependencies:
|
||||
is-typedarray "^1.0.0"
|
||||
|
||||
typescript@4.6.3:
|
||||
version "4.6.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c"
|
||||
integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==
|
||||
typescript@4.7.2:
|
||||
version "4.7.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.2.tgz#1f9aa2ceb9af87cca227813b4310fff0b51593c4"
|
||||
integrity sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A==
|
||||
|
||||
unbox-primitive@^1.0.1:
|
||||
version "1.0.1"
|
||||
|
||||
Reference in new issue
Block a user