From 54582cba4588c15c17441873b99d18b716b3d193 Mon Sep 17 00:00:00 2001 From: camc314 <18101008+camc314@users.noreply.github.com> Date: Sun, 29 Jun 2025 22:54:02 +0000 Subject: [PATCH] refactor(ast): add `AstKind` for `BindingProperty` (#11974) --- crates/oxc_ast/src/ast_kind_impl.rs | 2 + crates/oxc_ast/src/generated/ast_kind.rs | 249 +++++++++--------- crates/oxc_ast_visit/src/generated/visit.rs | 4 +- .../oxc_ast_visit/src/generated/visit_mut.rs | 4 +- .../oxc_formatter/src/generated/ast_nodes.rs | 9 +- crates/oxc_formatter/src/generated/format.rs | 10 +- .../oxc_linter/src/rules/eslint/id_length.rs | 24 +- .../unicorn/prefer_dom_node_text_content.rs | 8 +- .../fixtures/oxc/js/try-catch/parameters.snap | 4 +- .../class/declaration/method.snap | 4 +- .../class/expression/method.snap | 4 +- .../decorators/parameter.snap | 2 +- .../functions/arrow/params.snap | 6 +- .../function-declaration/params.snap | 6 +- .../functions/function-expression/params.snap | 6 +- .../parameter-object-destructure.snap | 2 +- .../variable-object-destructure.snap | 2 +- .../function/params/object-pattern.snap | 2 +- tasks/ast_tools/src/generators/ast_kind.rs | 1 - 19 files changed, 196 insertions(+), 153 deletions(-) diff --git a/crates/oxc_ast/src/ast_kind_impl.rs b/crates/oxc_ast/src/ast_kind_impl.rs index b9111dc1da00b..2262b145d8a7e 100644 --- a/crates/oxc_ast/src/ast_kind_impl.rs +++ b/crates/oxc_ast/src/ast_kind_impl.rs @@ -229,6 +229,8 @@ impl AstKind<'_> { Self::AccessorProperty(_) => "AccessorProperty".into(), + Self::BindingProperty(_) => "BindingProperty".into(), + Self::ArrayExpression(_) => "ArrayExpression".into(), Self::ArrowFunctionExpression(_) => "ArrowFunctionExpression".into(), Self::AssignmentExpression(_) => "AssignmentExpression".into(), diff --git a/crates/oxc_ast/src/generated/ast_kind.rs b/crates/oxc_ast/src/generated/ast_kind.rs index e770da8ce352d..1b6f2f7bf16ac 100644 --- a/crates/oxc_ast/src/generated/ast_kind.rs +++ b/crates/oxc_ast/src/generated/ast_kind.rs @@ -81,126 +81,127 @@ pub enum AstType { DebuggerStatement = 64, AssignmentPattern = 65, ObjectPattern = 66, - ArrayPattern = 67, - BindingRestElement = 68, - Function = 69, - FormalParameters = 70, - FormalParameter = 71, - FunctionBody = 72, - ArrowFunctionExpression = 73, - YieldExpression = 74, - Class = 75, - ClassBody = 76, - MethodDefinition = 77, - PropertyDefinition = 78, - PrivateIdentifier = 79, - StaticBlock = 80, - ModuleDeclaration = 81, - AccessorProperty = 82, - ImportExpression = 83, - ImportDeclaration = 84, - ImportSpecifier = 85, - ImportDefaultSpecifier = 86, - ImportNamespaceSpecifier = 87, - WithClause = 88, - ImportAttribute = 89, - ExportNamedDeclaration = 90, - ExportDefaultDeclaration = 91, - ExportAllDeclaration = 92, - ExportSpecifier = 93, - V8IntrinsicExpression = 94, - BooleanLiteral = 95, - NullLiteral = 96, - NumericLiteral = 97, - StringLiteral = 98, - BigIntLiteral = 99, - RegExpLiteral = 100, - JSXElement = 101, - JSXOpeningElement = 102, - JSXClosingElement = 103, - JSXFragment = 104, - JSXOpeningFragment = 105, - JSXClosingFragment = 106, - JSXNamespacedName = 107, - JSXMemberExpression = 108, - JSXExpressionContainer = 109, - JSXEmptyExpression = 110, - JSXAttribute = 111, - JSXSpreadAttribute = 112, - JSXIdentifier = 113, - JSXSpreadChild = 114, - JSXText = 115, - TSThisParameter = 116, - TSEnumDeclaration = 117, - TSEnumBody = 118, - TSEnumMember = 119, - TSTypeAnnotation = 120, - TSLiteralType = 121, - TSConditionalType = 122, - TSUnionType = 123, - TSIntersectionType = 124, - TSParenthesizedType = 125, - TSTypeOperator = 126, - TSArrayType = 127, - TSIndexedAccessType = 128, - TSTupleType = 129, - TSNamedTupleMember = 130, - TSOptionalType = 131, - TSRestType = 132, - TSAnyKeyword = 133, - TSStringKeyword = 134, - TSBooleanKeyword = 135, - TSNumberKeyword = 136, - TSNeverKeyword = 137, - TSIntrinsicKeyword = 138, - TSUnknownKeyword = 139, - TSNullKeyword = 140, - TSUndefinedKeyword = 141, - TSVoidKeyword = 142, - TSSymbolKeyword = 143, - TSThisType = 144, - TSObjectKeyword = 145, - TSBigIntKeyword = 146, - TSTypeReference = 147, - TSTypeName = 148, - TSQualifiedName = 149, - TSTypeParameterInstantiation = 150, - TSTypeParameter = 151, - TSTypeParameterDeclaration = 152, - TSTypeAliasDeclaration = 153, - TSClassImplements = 154, - TSInterfaceDeclaration = 155, - TSInterfaceBody = 156, - TSPropertySignature = 157, - TSIndexSignature = 158, - TSCallSignatureDeclaration = 159, - TSMethodSignature = 160, - TSConstructSignatureDeclaration = 161, - TSIndexSignatureName = 162, - TSInterfaceHeritage = 163, - TSTypePredicate = 164, - TSModuleDeclaration = 165, - TSModuleBlock = 166, - TSTypeLiteral = 167, - TSInferType = 168, - TSTypeQuery = 169, - TSImportType = 170, - TSConstructorType = 171, - TSMappedType = 172, - TSTemplateLiteralType = 173, - TSAsExpression = 174, - TSSatisfiesExpression = 175, - TSTypeAssertion = 176, - TSImportEqualsDeclaration = 177, - TSExternalModuleReference = 178, - TSNonNullExpression = 179, - Decorator = 180, - TSExportAssignment = 181, - TSNamespaceExportDeclaration = 182, - TSInstantiationExpression = 183, - JSDocNullableType = 184, - JSDocNonNullableType = 185, - JSDocUnknownType = 186, + BindingProperty = 67, + ArrayPattern = 68, + BindingRestElement = 69, + Function = 70, + FormalParameters = 71, + FormalParameter = 72, + FunctionBody = 73, + ArrowFunctionExpression = 74, + YieldExpression = 75, + Class = 76, + ClassBody = 77, + MethodDefinition = 78, + PropertyDefinition = 79, + PrivateIdentifier = 80, + StaticBlock = 81, + ModuleDeclaration = 82, + AccessorProperty = 83, + ImportExpression = 84, + ImportDeclaration = 85, + ImportSpecifier = 86, + ImportDefaultSpecifier = 87, + ImportNamespaceSpecifier = 88, + WithClause = 89, + ImportAttribute = 90, + ExportNamedDeclaration = 91, + ExportDefaultDeclaration = 92, + ExportAllDeclaration = 93, + ExportSpecifier = 94, + V8IntrinsicExpression = 95, + BooleanLiteral = 96, + NullLiteral = 97, + NumericLiteral = 98, + StringLiteral = 99, + BigIntLiteral = 100, + RegExpLiteral = 101, + JSXElement = 102, + JSXOpeningElement = 103, + JSXClosingElement = 104, + JSXFragment = 105, + JSXOpeningFragment = 106, + JSXClosingFragment = 107, + JSXNamespacedName = 108, + JSXMemberExpression = 109, + JSXExpressionContainer = 110, + JSXEmptyExpression = 111, + JSXAttribute = 112, + JSXSpreadAttribute = 113, + JSXIdentifier = 114, + JSXSpreadChild = 115, + JSXText = 116, + TSThisParameter = 117, + TSEnumDeclaration = 118, + TSEnumBody = 119, + TSEnumMember = 120, + TSTypeAnnotation = 121, + TSLiteralType = 122, + TSConditionalType = 123, + TSUnionType = 124, + TSIntersectionType = 125, + TSParenthesizedType = 126, + TSTypeOperator = 127, + TSArrayType = 128, + TSIndexedAccessType = 129, + TSTupleType = 130, + TSNamedTupleMember = 131, + TSOptionalType = 132, + TSRestType = 133, + TSAnyKeyword = 134, + TSStringKeyword = 135, + TSBooleanKeyword = 136, + TSNumberKeyword = 137, + TSNeverKeyword = 138, + TSIntrinsicKeyword = 139, + TSUnknownKeyword = 140, + TSNullKeyword = 141, + TSUndefinedKeyword = 142, + TSVoidKeyword = 143, + TSSymbolKeyword = 144, + TSThisType = 145, + TSObjectKeyword = 146, + TSBigIntKeyword = 147, + TSTypeReference = 148, + TSTypeName = 149, + TSQualifiedName = 150, + TSTypeParameterInstantiation = 151, + TSTypeParameter = 152, + TSTypeParameterDeclaration = 153, + TSTypeAliasDeclaration = 154, + TSClassImplements = 155, + TSInterfaceDeclaration = 156, + TSInterfaceBody = 157, + TSPropertySignature = 158, + TSIndexSignature = 159, + TSCallSignatureDeclaration = 160, + TSMethodSignature = 161, + TSConstructSignatureDeclaration = 162, + TSIndexSignatureName = 163, + TSInterfaceHeritage = 164, + TSTypePredicate = 165, + TSModuleDeclaration = 166, + TSModuleBlock = 167, + TSTypeLiteral = 168, + TSInferType = 169, + TSTypeQuery = 170, + TSImportType = 171, + TSConstructorType = 172, + TSMappedType = 173, + TSTemplateLiteralType = 174, + TSAsExpression = 175, + TSSatisfiesExpression = 176, + TSTypeAssertion = 177, + TSImportEqualsDeclaration = 178, + TSExternalModuleReference = 179, + TSNonNullExpression = 180, + Decorator = 181, + TSExportAssignment = 182, + TSNamespaceExportDeclaration = 183, + TSInstantiationExpression = 184, + JSDocNullableType = 185, + JSDocNonNullableType = 186, + JSDocUnknownType = 187, } /// Untyped AST Node Kind @@ -279,6 +280,7 @@ pub enum AstKind<'a> { DebuggerStatement(&'a DebuggerStatement) = AstType::DebuggerStatement as u8, AssignmentPattern(&'a AssignmentPattern<'a>) = AstType::AssignmentPattern as u8, ObjectPattern(&'a ObjectPattern<'a>) = AstType::ObjectPattern as u8, + BindingProperty(&'a BindingProperty<'a>) = AstType::BindingProperty as u8, ArrayPattern(&'a ArrayPattern<'a>) = AstType::ArrayPattern as u8, BindingRestElement(&'a BindingRestElement<'a>) = AstType::BindingRestElement as u8, Function(&'a Function<'a>) = AstType::Function as u8, @@ -494,6 +496,7 @@ impl GetSpan for AstKind<'_> { Self::DebuggerStatement(it) => it.span(), Self::AssignmentPattern(it) => it.span(), Self::ObjectPattern(it) => it.span(), + Self::BindingProperty(it) => it.span(), Self::ArrayPattern(it) => it.span(), Self::BindingRestElement(it) => it.span(), Self::Function(it) => it.span(), @@ -688,6 +691,7 @@ impl GetAddress for AstKind<'_> { Self::DebuggerStatement(it) => Address::from_ptr(it), Self::AssignmentPattern(it) => Address::from_ptr(it), Self::ObjectPattern(it) => Address::from_ptr(it), + Self::BindingProperty(it) => Address::from_ptr(it), Self::ArrayPattern(it) => Address::from_ptr(it), Self::BindingRestElement(it) => Address::from_ptr(it), Self::Function(it) => Address::from_ptr(it), @@ -1148,6 +1152,11 @@ impl<'a> AstKind<'a> { if let Self::ObjectPattern(v) = self { Some(v) } else { None } } + #[inline] + pub fn as_binding_property(self) -> Option<&'a BindingProperty<'a>> { + if let Self::BindingProperty(v) = self { Some(v) } else { None } + } + #[inline] pub fn as_array_pattern(self) -> Option<&'a ArrayPattern<'a>> { if let Self::ArrayPattern(v) = self { Some(v) } else { None } diff --git a/crates/oxc_ast_visit/src/generated/visit.rs b/crates/oxc_ast_visit/src/generated/visit.rs index ebed981503b26..f55347e2aa9ef 100644 --- a/crates/oxc_ast_visit/src/generated/visit.rs +++ b/crates/oxc_ast_visit/src/generated/visit.rs @@ -2388,10 +2388,12 @@ pub mod walk { #[inline] pub fn walk_binding_property<'a, V: Visit<'a>>(visitor: &mut V, it: &BindingProperty<'a>) { - // No `AstKind` for this type + let kind = AstKind::BindingProperty(visitor.alloc(it)); + visitor.enter_node(kind); visitor.visit_span(&it.span); visitor.visit_property_key(&it.key); visitor.visit_binding_pattern(&it.value); + visitor.leave_node(kind); } #[inline] diff --git a/crates/oxc_ast_visit/src/generated/visit_mut.rs b/crates/oxc_ast_visit/src/generated/visit_mut.rs index 92d78ef820129..572a50fa63297 100644 --- a/crates/oxc_ast_visit/src/generated/visit_mut.rs +++ b/crates/oxc_ast_visit/src/generated/visit_mut.rs @@ -2461,10 +2461,12 @@ pub mod walk_mut { visitor: &mut V, it: &mut BindingProperty<'a>, ) { - // No `AstType` for this type + let kind = AstType::BindingProperty; + visitor.enter_node(kind); visitor.visit_span(&mut it.span); visitor.visit_property_key(&mut it.key); visitor.visit_binding_pattern(&mut it.value); + visitor.leave_node(kind); } #[inline] diff --git a/crates/oxc_formatter/src/generated/ast_nodes.rs b/crates/oxc_formatter/src/generated/ast_nodes.rs index 84a3a91e266fe..7190de738fb4a 100644 --- a/crates/oxc_formatter/src/generated/ast_nodes.rs +++ b/crates/oxc_formatter/src/generated/ast_nodes.rs @@ -94,6 +94,7 @@ pub enum AstNodes<'a> { DebuggerStatement(&'a AstNode<'a, DebuggerStatement>), AssignmentPattern(&'a AstNode<'a, AssignmentPattern<'a>>), ObjectPattern(&'a AstNode<'a, ObjectPattern<'a>>), + BindingProperty(&'a AstNode<'a, BindingProperty<'a>>), ArrayPattern(&'a AstNode<'a, ArrayPattern<'a>>), BindingRestElement(&'a AstNode<'a, BindingRestElement<'a>>), Function(&'a AstNode<'a, Function<'a>>), @@ -2381,6 +2382,7 @@ impl<'a> AstNodes<'a> { Self::DebuggerStatement(n) => n.span(), Self::AssignmentPattern(n) => n.span(), Self::ObjectPattern(n) => n.span(), + Self::BindingProperty(n) => n.span(), Self::ArrayPattern(n) => n.span(), Self::BindingRestElement(n) => n.span(), Self::Function(n) => n.span(), @@ -2574,6 +2576,7 @@ impl<'a> AstNodes<'a> { Self::DebuggerStatement(n) => n.parent, Self::AssignmentPattern(n) => n.parent, Self::ObjectPattern(n) => n.parent, + Self::BindingProperty(n) => n.parent, Self::ArrayPattern(n) => n.parent, Self::BindingRestElement(n) => n.parent, Self::Function(n) => n.parent, @@ -2767,6 +2770,7 @@ impl<'a> AstNodes<'a> { Self::DebuggerStatement(n) => SiblingNode::from(n.inner), Self::AssignmentPattern(n) => SiblingNode::from(n.inner), Self::ObjectPattern(n) => SiblingNode::from(n.inner), + Self::BindingProperty(n) => SiblingNode::from(n.inner), Self::ArrayPattern(n) => SiblingNode::from(n.inner), Self::BindingRestElement(n) => SiblingNode::from(n.inner), Self::Function(n) => SiblingNode::from(n.inner), @@ -2960,6 +2964,7 @@ impl<'a> AstNodes<'a> { Self::DebuggerStatement(_) => "DebuggerStatement", Self::AssignmentPattern(_) => "AssignmentPattern", Self::ObjectPattern(_) => "ObjectPattern", + Self::BindingProperty(_) => "BindingProperty", Self::ArrayPattern(_) => "ArrayPattern", Self::BindingRestElement(_) => "BindingRestElement", Self::Function(_) => "Function", @@ -6177,7 +6182,7 @@ impl<'a> AstNode<'a, BindingProperty<'a>> { self.allocator.alloc(AstNode { inner: &self.inner.key, allocator: self.allocator, - parent: self.parent, + parent: self.allocator.alloc(AstNodes::BindingProperty(transmute_self(self))), following_node, }) } @@ -6188,7 +6193,7 @@ impl<'a> AstNode<'a, BindingProperty<'a>> { self.allocator.alloc(AstNode { inner: &self.inner.value, allocator: self.allocator, - parent: self.parent, + parent: self.allocator.alloc(AstNodes::BindingProperty(transmute_self(self))), following_node, }) } diff --git a/crates/oxc_formatter/src/generated/format.rs b/crates/oxc_formatter/src/generated/format.rs index d06acc8ed1fe3..0326506d999d1 100644 --- a/crates/oxc_formatter/src/generated/format.rs +++ b/crates/oxc_formatter/src/generated/format.rs @@ -1151,7 +1151,15 @@ impl<'a> Format<'a> for AstNode<'a, ObjectPattern<'a>> { impl<'a> Format<'a> for AstNode<'a, BindingProperty<'a>> { fn fmt(&self, f: &mut Formatter<'_, 'a>) -> FormatResult<()> { - self.write(f) + format_leading_comments(self.span).fmt(f)?; + let result = self.write(f); + format_trailing_comments( + &self.parent.as_sibling_node(), + &SiblingNode::from(self.inner), + self.following_node.as_ref(), + ) + .fmt(f)?; + result } } diff --git a/crates/oxc_linter/src/rules/eslint/id_length.rs b/crates/oxc_linter/src/rules/eslint/id_length.rs index 96336f85e11b1..0d65424180071 100644 --- a/crates/oxc_linter/src/rules/eslint/id_length.rs +++ b/crates/oxc_linter/src/rules/eslint/id_length.rs @@ -237,13 +237,19 @@ impl IdLength { return; } } - AstKind::ObjectPattern(object_pattern) => { - let binding_property_option = - object_pattern.properties.iter().find(|x| x.span == ident.span); - - if IdLength::is_binding_identifier_or_object_pattern(binding_property_option) - && self.properties == PropertyKind::Never + AstKind::BindingProperty(_) => { + if let Some(AstKind::ObjectPattern(object_pattern)) = + ctx.nodes().parent_kind(parent_node.id()) { + let binding_property_option = + object_pattern.properties.iter().find(|x| x.span == ident.span); + + if IdLength::is_binding_identifier_or_object_pattern(binding_property_option) + && self.properties == PropertyKind::Never + { + return; + } + } else { return; } } @@ -301,9 +307,13 @@ impl IdLength { return; } - let Some(parent_parent_node) = ctx.nodes().parent_node(parent_node.id()) else { + let Some(mut parent_parent_node) = ctx.nodes().parent_node(parent_node.id()) else { return; }; + if matches!(parent_parent_node.kind(), AstKind::BindingProperty(_)) { + parent_parent_node = ctx.nodes().parent_node(parent_parent_node.id()).unwrap(); + } + match parent_parent_node.kind() { AstKind::ObjectPattern(object_pattern) => { // TODO: Is there a better way to do this check? diff --git a/crates/oxc_linter/src/rules/unicorn/prefer_dom_node_text_content.rs b/crates/oxc_linter/src/rules/unicorn/prefer_dom_node_text_content.rs index df1622bc1a49d..cb33085b81ba1 100644 --- a/crates/oxc_linter/src/rules/unicorn/prefer_dom_node_text_content.rs +++ b/crates/oxc_linter/src/rules/unicorn/prefer_dom_node_text_content.rs @@ -62,11 +62,17 @@ impl Rule for PreferDomNodeTextContent { } let mut ancestor_kinds = ctx.nodes().ancestor_kinds(node.id()).skip(1); - let (Some(parent_node_kind), Some(grand_parent_node_kind)) = + let (Some(parent_node_kind), Some(mut grand_parent_node_kind)) = (ancestor_kinds.next(), ancestor_kinds.next()) else { return; }; + if matches!(grand_parent_node_kind, AstKind::BindingProperty(_)) { + grand_parent_node_kind = match ancestor_kinds.next() { + Some(kind) => kind, + None => return, + }; + } if matches!(parent_node_kind, AstKind::PropertyKey(_)) && (matches!(grand_parent_node_kind, AstKind::ObjectPattern(_)) diff --git a/crates/oxc_semantic/tests/fixtures/oxc/js/try-catch/parameters.snap b/crates/oxc_semantic/tests/fixtures/oxc/js/try-catch/parameters.snap index a71051d30f73d..a85c53237895c 100644 --- a/crates/oxc_semantic/tests/fixtures/oxc/js/try-catch/parameters.snap +++ b/crates/oxc_semantic/tests/fixtures/oxc/js/try-catch/parameters.snap @@ -30,7 +30,7 @@ input_file: crates/oxc_semantic/tests/fixtures/oxc/js/try-catch/parameters.js "flags": "ReferenceFlags(Read)", "id": 1, "name": "a", - "node_id": 22 + "node_id": 24 } ] }, @@ -78,7 +78,7 @@ input_file: crates/oxc_semantic/tests/fixtures/oxc/js/try-catch/parameters.js "flags": "ReferenceFlags(Read)", "id": 0, "name": "A", - "node_id": 17 + "node_id": 18 } ] } diff --git a/crates/oxc_semantic/tests/fixtures/typescript-eslint/class/declaration/method.snap b/crates/oxc_semantic/tests/fixtures/typescript-eslint/class/declaration/method.snap index 77b3be26f3672..18cdeec9b1f4a 100644 --- a/crates/oxc_semantic/tests/fixtures/typescript-eslint/class/declaration/method.snap +++ b/crates/oxc_semantic/tests/fixtures/typescript-eslint/class/declaration/method.snap @@ -23,13 +23,13 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/class/declarati "flags": "ReferenceFlags(Read)", "id": 0, "name": "a", - "node_id": 26 + "node_id": 27 }, { "flags": "ReferenceFlags(Read)", "id": 1, "name": "a", - "node_id": 31 + "node_id": 32 } ] }, diff --git a/crates/oxc_semantic/tests/fixtures/typescript-eslint/class/expression/method.snap b/crates/oxc_semantic/tests/fixtures/typescript-eslint/class/expression/method.snap index d1e29b924c12e..cd343959f3052 100644 --- a/crates/oxc_semantic/tests/fixtures/typescript-eslint/class/expression/method.snap +++ b/crates/oxc_semantic/tests/fixtures/typescript-eslint/class/expression/method.snap @@ -23,13 +23,13 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/class/expressio "flags": "ReferenceFlags(Read)", "id": 0, "name": "a", - "node_id": 28 + "node_id": 29 }, { "flags": "ReferenceFlags(Read)", "id": 1, "name": "a", - "node_id": 33 + "node_id": 34 } ] }, diff --git a/crates/oxc_semantic/tests/fixtures/typescript-eslint/decorators/parameter.snap b/crates/oxc_semantic/tests/fixtures/typescript-eslint/decorators/parameter.snap index 1ef6c5a0b0373..2ee3b5d4a88a5 100644 --- a/crates/oxc_semantic/tests/fixtures/typescript-eslint/decorators/parameter.snap +++ b/crates/oxc_semantic/tests/fixtures/typescript-eslint/decorators/parameter.snap @@ -89,7 +89,7 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/decorators/para "flags": "ReferenceFlags(Read)", "id": 3, "name": "decorator", - "node_id": 31 + "node_id": 32 } ] }, diff --git a/crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/arrow/params.snap b/crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/arrow/params.snap index 412d7876f9143..d93ce1c21bdf3 100644 --- a/crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/arrow/params.snap +++ b/crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/arrow/params.snap @@ -21,13 +21,13 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/arrow "flags": "ReferenceFlags(Read)", "id": 0, "name": "a", - "node_id": 25 + "node_id": 26 }, { "flags": "ReferenceFlags(Read)", "id": 2, "name": "a", - "node_id": 34 + "node_id": 35 } ] }, @@ -90,7 +90,7 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/arrow "flags": "ReferenceFlags(Read)", "id": 1, "name": "outer", - "node_id": 29 + "node_id": 30 } ] }, diff --git a/crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/function-declaration/params.snap b/crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/function-declaration/params.snap index ee552799b141c..497369a131356 100644 --- a/crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/function-declaration/params.snap +++ b/crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/function-declaration/params.snap @@ -21,13 +21,13 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/funct "flags": "ReferenceFlags(Read)", "id": 0, "name": "a", - "node_id": 25 + "node_id": 26 }, { "flags": "ReferenceFlags(Read)", "id": 2, "name": "a", - "node_id": 34 + "node_id": 35 } ] }, @@ -90,7 +90,7 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/funct "flags": "ReferenceFlags(Read)", "id": 1, "name": "outer", - "node_id": 29 + "node_id": 30 } ] }, diff --git a/crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/function-expression/params.snap b/crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/function-expression/params.snap index 423b01f09c548..5184ca9df58dc 100644 --- a/crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/function-expression/params.snap +++ b/crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/function-expression/params.snap @@ -21,13 +21,13 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/funct "flags": "ReferenceFlags(Read)", "id": 0, "name": "a", - "node_id": 27 + "node_id": 28 }, { "flags": "ReferenceFlags(Read)", "id": 2, "name": "a", - "node_id": 36 + "node_id": 37 } ] }, @@ -90,7 +90,7 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/functions/funct "flags": "ReferenceFlags(Read)", "id": 1, "name": "outer", - "node_id": 31 + "node_id": 32 } ] }, diff --git a/crates/oxc_semantic/tests/fixtures/typescript-eslint/type-annotation/parameter-object-destructure.snap b/crates/oxc_semantic/tests/fixtures/typescript-eslint/type-annotation/parameter-object-destructure.snap index 74a7c5f97a9ac..82296a47a42d0 100644 --- a/crates/oxc_semantic/tests/fixtures/typescript-eslint/type-annotation/parameter-object-destructure.snap +++ b/crates/oxc_semantic/tests/fixtures/typescript-eslint/type-annotation/parameter-object-destructure.snap @@ -42,7 +42,7 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/type-annotation "flags": "ReferenceFlags(Type)", "id": 0, "name": "T", - "node_id": 15 + "node_id": 16 } ] }, diff --git a/crates/oxc_semantic/tests/fixtures/typescript-eslint/type-annotation/variable-object-destructure.snap b/crates/oxc_semantic/tests/fixtures/typescript-eslint/type-annotation/variable-object-destructure.snap index add02a6505ac7..49904a64f3b53 100644 --- a/crates/oxc_semantic/tests/fixtures/typescript-eslint/type-annotation/variable-object-destructure.snap +++ b/crates/oxc_semantic/tests/fixtures/typescript-eslint/type-annotation/variable-object-destructure.snap @@ -27,7 +27,7 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/type-annotation "flags": "ReferenceFlags(Type)", "id": 0, "name": "T", - "node_id": 13 + "node_id": 14 } ] }, diff --git a/crates/oxc_semantic/tests/fixtures/typescript-eslint/type-declaration/function/params/object-pattern.snap b/crates/oxc_semantic/tests/fixtures/typescript-eslint/type-declaration/function/params/object-pattern.snap index 8dc07cc6bef27..04274ce133f80 100644 --- a/crates/oxc_semantic/tests/fixtures/typescript-eslint/type-declaration/function/params/object-pattern.snap +++ b/crates/oxc_semantic/tests/fixtures/typescript-eslint/type-declaration/function/params/object-pattern.snap @@ -29,7 +29,7 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/type-declaratio "flags": "ReferenceFlags(Type)", "id": 0, "name": "A", - "node_id": 21 + "node_id": 22 } ] } diff --git a/tasks/ast_tools/src/generators/ast_kind.rs b/tasks/ast_tools/src/generators/ast_kind.rs index c79dbafd70cbe..da0b600239cab 100644 --- a/tasks/ast_tools/src/generators/ast_kind.rs +++ b/tasks/ast_tools/src/generators/ast_kind.rs @@ -31,7 +31,6 @@ const STRUCTS_BLACK_LIST: &[&str] = &[ "AssignmentTargetPropertyIdentifier", "AssignmentTargetPropertyProperty", "BindingPattern", - "BindingProperty", "TSFunctionType", "Span", ];