Skip to content

Commit 68ea881

Browse files
authored
Update typescript to v4.9 (#13852)
1 parent 5e0b883 commit 68ea881

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"semver": "7.3.7",
8686
"string-width": "5.0.1",
8787
"strip-ansi": "7.0.1",
88-
"typescript": "4.8.2",
88+
"typescript": "4.9.3",
8989
"unicode-regex": "3.0.0",
9090
"unified": "9.2.1",
9191
"vnopts": "1.0.2",

src/language-js/parse/postprocess/typescript.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@ const isNonEmptyArray = require("../../../utils/is-non-empty-array.js");
44
const visitNode = require("./visit-node.js");
55
const throwSyntaxError = require("./throw-syntax-error.js");
66

7+
// Taken from `typescript` package
8+
const SyntaxKind = {
9+
AbstractKeyword: 126,
10+
SourceFile: 308,
11+
PropertyDeclaration: 169,
12+
};
13+
714
// Copied from https://unpkg.com/typescript@4.8.2/lib/typescript.js
815
function getSourceFileOfNode(node) {
9-
while (node && node.kind !== 305 /* SyntaxKind.SourceFile */) {
16+
while (node && node.kind !== SyntaxKind.SourceFile) {
1017
node = node.parent;
1118
}
1219
return node;
@@ -36,13 +43,11 @@ function throwErrorForInvalidDecorator(tsNode) {
3643
// Values of abstract property is removed since `@typescript-eslint/typescript-estree` v5
3744
// https://github.com/typescript-eslint/typescript-eslint/releases/tag/v5.0.0
3845
function throwErrorForInvalidAbstractProperty(tsNode, esTreeNode) {
39-
const SYNTAX_KIND_PROPERTY_DEFINITION = 167;
40-
const SYNTAX_KIND_ABSTRACT_KEYWORD = 126;
4146
if (
42-
tsNode.kind !== SYNTAX_KIND_PROPERTY_DEFINITION ||
47+
tsNode.kind !== SyntaxKind.PropertyDeclaration ||
4348
(tsNode.modifiers &&
4449
!tsNode.modifiers.some(
45-
(modifier) => modifier.kind === SYNTAX_KIND_ABSTRACT_KEYWORD
50+
(modifier) => modifier.kind === SyntaxKind.AbstractKeyword
4651
))
4752
) {
4853
return;

yarn.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,9 +1710,9 @@
17101710
integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=
17111711

17121712
"@types/node@*":
1713-
version "17.0.15"
1714-
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.15.tgz#97779282c09c09577120a2162e71d8380003590a"
1715-
integrity sha512-zWt4SDDv1S9WRBNxLFxFRHxdD9tvH8f5/kg5/IaLFdnSNXsDY4eL3Q3XXN+VxUnWIhyVFDwcsmAprvwXoM/ClA==
1713+
version "18.11.9"
1714+
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4"
1715+
integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==
17161716

17171717
"@types/normalize-package-data@^2.4.0":
17181718
version "2.4.1"
@@ -6504,10 +6504,10 @@ typedarray-to-buffer@^3.1.5:
65046504
dependencies:
65056505
is-typedarray "^1.0.0"
65066506

6507-
typescript@4.8.2:
6508-
version "4.8.2"
6509-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.2.tgz#e3b33d5ccfb5914e4eeab6699cf208adee3fd790"
6510-
integrity sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==
6507+
typescript@4.9.3:
6508+
version "4.9.3"
6509+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.3.tgz#3aea307c1746b8c384435d8ac36b8a2e580d85db"
6510+
integrity sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==
65116511

65126512
unbox-primitive@^1.0.1:
65136513
version "1.0.1"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy