Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f04083a

Browse files
authored
[Babel 8] Align TSMappedType AST (#17479)
1 parent 453b068 commit f04083a

File tree

6 files changed

+137
-100
lines changed

6 files changed

+137
-100
lines changed

eslint/babel-eslint-parser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@typescript-eslint/scope-manager": "^6.19.0",
5252
"dedent": "^1.5.3",
5353
"eslint": "^9.21.0",
54-
"typescript-eslint": "8.29.1"
54+
"typescript-eslint": "8.39.1"
5555
},
5656
"conditions": {
5757
"BABEL_8_BREAKING": [

eslint/babel-eslint-parser/test/typescript-estree.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ function deeplyRemoveProperties(obj, props) {
341341
// Pending release https://github.com/microsoft/TypeScript/pull/61764
342342
"typescript/explicit-resource-management/valid-for-using-declaration-binding-of/input.js",
343343

344-
// Pending ts-eslint upgrade
344+
// Pending https://github.com/typescript-eslint/typescript-eslint/issues/11474
345345
"typescript/types/import-type-options-with-trailing-comma/input.ts",
346346

347347
// ts-eslint/tsc does not support arrow generic in tsx mode

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
"semver": "^6.3.1",
8585
"shelljs": "^0.8.5",
8686
"test262-stream": "^1.4.0",
87-
"typescript": "5.8.3",
88-
"typescript-eslint": "8.29.1"
87+
"typescript": "5.9.2",
88+
"typescript-eslint": "8.39.1"
8989
},
9090
"workspaces": [
9191
"codemods/*",

packages/babel-parser/src/plugins/typescript/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4575,6 +4575,10 @@ export default (superClass: ClassWithMixin<typeof Parser, IJSXParserMixin>) =>
45754575
node.declare ??= false;
45764576
node.extends ??= [];
45774577
return;
4578+
case "TSMappedType":
4579+
node.optional ??= false;
4580+
node.readonly ??= undefined;
4581+
return;
45784582
case "TSModuleDeclaration":
45794583
node.declare ??= false;
45804584
node.global ??= node.kind === "global";

packages/babel-parser/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,7 @@ export interface TsMappedType extends TsTypeBase {
18121812
key: Identifier;
18131813
constraint: TsType;
18141814
readonly?: true | "+" | "-";
1815-
optional?: true | "+" | "-";
1815+
optional?: boolean | "+" | "-";
18161816
typeAnnotation: TsType | undefined | null;
18171817
nameType: TsType | undefined | null;
18181818
}

0 commit comments

Comments
 (0)