Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TypeScript 5.0 #14505

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog_unreleased/typescript/14391-2.md
@@ -1,4 +1,4 @@
#### Support TypeScript 5.0 via `babel-ts` parser (#14391 by @fisker)
#### Support TypeScript 5.0 parser (#14391 by @fisker, #14505 by @sosukesuzuki)

TypeScript 5.0 introduces two new syntactic features:

Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -38,8 +38,8 @@
"@iarna/toml": "2.2.5",
"@prettier/is-es5-identifier-name": "0.1.0",
"@prettier/parse-srcset": "2.0.2",
"@typescript-eslint/typescript-estree": "5.54.1",
"@typescript-eslint/visitor-keys": "5.54.1",
"@typescript-eslint/typescript-estree": "5.55.0",
"@typescript-eslint/visitor-keys": "5.55.0",
"acorn": "8.8.2",
"acorn-jsx": "5.3.2",
"angular-estree-parser": "6.0.0",
Expand Down Expand Up @@ -97,7 +97,7 @@
"string-width": "5.0.1",
"strip-ansi": "7.0.1",
"to-fast-properties": "4.0.0",
"typescript": "4.9.5",
"typescript": "5.0.1-rc",
"unicode-regex": "3.0.0",
"unified": "9.2.2",
"vnopts": "1.0.2",
Expand Down
Expand Up @@ -49,7 +49,7 @@ exports[`3.ts [typescript] format 1`] = `
2 |"
`;

exports[`4.ts [babel-ts] format 1`] = `
exports[`4.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
Expand All @@ -66,13 +66,6 @@ printWidth: 80
================================================================================
`;

exports[`4.ts [typescript] format 1`] = `
"Expression expected. (1:2)
> 1 | (@f<<T>(v: T) => void>() class {});
| ^
2 |"
`;

exports[`5.tsx [babel-ts] format 1`] = `
====================================options=====================================
parsers: ["typescript"]
Expand Down
@@ -1,3 +1,3 @@
run_spec(import.meta, ["typescript"], {
errors: { typescript: ["3.ts", "4.ts", "5.tsx"] },
errors: { typescript: ["3.ts", "5.tsx"] },
});
Expand Up @@ -286,7 +286,7 @@ const appIDs = createSelector(
================================================================================
`;

exports[`const.ts [babel-ts] format 1`] = `
exports[`const.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
Expand Down Expand Up @@ -362,15 +362,6 @@ class _ {
================================================================================
`;

exports[`const.ts [typescript] format 1`] = `
"Type parameter declaration expected. (1:12)
> 1 | function a<const T>() {}
| ^
2 | function b<const T extends U>() {}
3 | function c<T, const U>() {}
4 | declare function d<const T>();"
`;

exports[`long-function-arg.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
Expand Down
2 changes: 1 addition & 1 deletion tests/format/typescript/typeparams/jsfmt.spec.js
@@ -1 +1 @@
run_spec(import.meta, ["typescript"], { errors: { typescript: ["const.ts"] } });
run_spec(import.meta, ["typescript"]);
57 changes: 46 additions & 11 deletions yarn.lock
Expand Up @@ -1831,6 +1831,13 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/types@npm:5.55.0":
version: 5.55.0
resolution: "@typescript-eslint/types@npm:5.55.0"
checksum: 7d851f09a2106514d3a9c7164d34758f30abfe554e3c7a02be75cdc7e16644e23ca32840a8f39a0321bc509927fb4d98ce91b22b21e8544ac56cef33b815a864
languageName: node
linkType: hard

"@typescript-eslint/typescript-estree@npm:5.54.1":
version: 5.54.1
resolution: "@typescript-eslint/typescript-estree@npm:5.54.1"
Expand All @@ -1849,6 +1856,24 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/typescript-estree@npm:5.55.0":
version: 5.55.0
resolution: "@typescript-eslint/typescript-estree@npm:5.55.0"
dependencies:
"@typescript-eslint/types": 5.55.0
"@typescript-eslint/visitor-keys": 5.55.0
debug: ^4.3.4
globby: ^11.1.0
is-glob: ^4.0.3
semver: ^7.3.7
tsutils: ^3.21.0
peerDependenciesMeta:
typescript:
optional: true
checksum: d24a11aee3d01067018d99804f420aecb8af88e43bf170d5d14f6480bd378c0a81ce49a37f5d6c36e5f0f319e3fa8b099720f295f2767338be1a4f7e9a5323e1
languageName: node
linkType: hard

"@typescript-eslint/utils@npm:5.54.1, @typescript-eslint/utils@npm:^5.10.0":
version: 5.54.1
resolution: "@typescript-eslint/utils@npm:5.54.1"
Expand Down Expand Up @@ -1877,6 +1902,16 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/visitor-keys@npm:5.55.0":
version: 5.55.0
resolution: "@typescript-eslint/visitor-keys@npm:5.55.0"
dependencies:
"@typescript-eslint/types": 5.55.0
eslint-visitor-keys: ^3.3.0
checksum: 0b24c72dff99dd2cf41c19d20067f8ab20a38aa2e82c79c5530bec7cf651031e95c80702fc21c813c9b94e5f3d4cd210f13967b2966ef38abe548cb5f05848a3
languageName: node
linkType: hard

"abbrev@npm:1":
version: 1.1.1
resolution: "abbrev@npm:1.1.1"
Expand Down Expand Up @@ -6746,8 +6781,8 @@ __metadata:
"@types/find-cache-dir": 3.2.1
"@types/jest": 29.4.0
"@typescript-eslint/eslint-plugin": 5.54.1
"@typescript-eslint/typescript-estree": 5.54.1
"@typescript-eslint/visitor-keys": 5.54.1
"@typescript-eslint/typescript-estree": 5.55.0
"@typescript-eslint/visitor-keys": 5.55.0
acorn: 8.8.2
acorn-jsx: 5.3.2
angular-estree-parser: 6.0.0
Expand Down Expand Up @@ -6842,7 +6877,7 @@ __metadata:
tempy: 3.0.0
to-fast-properties: 4.0.0
ts-expect: 1.3.0
typescript: 4.9.5
typescript: 5.0.1-rc
unicode-regex: 3.0.0
unified: 9.2.2
vnopts: 1.0.2
Expand Down Expand Up @@ -8133,23 +8168,23 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:4.9.5":
version: 4.9.5
resolution: "typescript@npm:4.9.5"
"typescript@npm:5.0.1-rc":
version: 5.0.1-rc
resolution: "typescript@npm:5.0.1-rc"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: ee000bc26848147ad423b581bd250075662a354d84f0e06eb76d3b892328d8d4440b7487b5a83e851b12b255f55d71835b008a66cbf8f255a11e4400159237db
checksum: 47e2381464f0b8a2d54ddb60ddd44a57577462d5faecd7db445b8b24a02d6f16d117fd4f49ba66fe8e22c49b79f5bfb1b6851e1e32e29c6d4c2ab324bc184b70
languageName: node
linkType: hard

"typescript@patch:typescript@4.9.5#~builtin<compat/typescript>":
version: 4.9.5
resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin<compat/typescript>::version=4.9.5&hash=23ec76"
"typescript@patch:typescript@5.0.1-rc#~builtin<compat/typescript>":
version: 5.0.1-rc
resolution: "typescript@patch:typescript@npm%3A5.0.1-rc#~builtin<compat/typescript>::version=5.0.1-rc&hash=1f5320"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: ab417a2f398380c90a6cf5a5f74badd17866adf57f1165617d6a551f059c3ba0a3e4da0d147b3ac5681db9ac76a303c5876394b13b3de75fdd5b1eaa06181c9d
checksum: 61b43eb0e562e61f311c3138854d75a7d9f57153df6b7a4a509db76ae8aea2029116186fb391fa266c00b1e36c16daa075baf5e23f0bb133f9281adf6ca308f7
languageName: node
linkType: hard

Expand Down