diff --git a/apps/oxlint/src-js/generated/types.d.ts b/apps/oxlint/src-js/generated/types.d.ts index fac411cef998f..9d68c8cb2af83 100644 --- a/apps/oxlint/src-js/generated/types.d.ts +++ b/apps/oxlint/src-js/generated/types.d.ts @@ -673,6 +673,7 @@ export interface FormalParameterRest extends Span { optional?: boolean; typeAnnotation?: TSTypeAnnotation | null; value?: null; + parent: Node; } export type FormalParameter = { @@ -687,6 +688,7 @@ export interface TSParameterProperty extends Span { parameter: FormalParameter; readonly: boolean; static: boolean; + parent: Node; } export interface FunctionBody extends Span { diff --git a/apps/oxlint/src-js/plugins/scope.ts b/apps/oxlint/src-js/plugins/scope.ts index 636d131211f81..73ab6c18278ea 100644 --- a/apps/oxlint/src-js/plugins/scope.ts +++ b/apps/oxlint/src-js/plugins/scope.ts @@ -261,8 +261,6 @@ export function getScope(node: ESTree.Node): Scope { return scope.type === 'function-expression-name' ? scope.childScopes[0] : scope; } - // TODO: `TSParameterProperty` type should have a `parent` property. - // @ts-expect-error node = node.parent; } while (node !== null); diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index c6ae3006cdc9d..05dc7c95d6800 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -1851,6 +1851,7 @@ pub enum FunctionType { optional?: boolean; typeAnnotation?: TSTypeAnnotation | null; value?: null; + parent/* IF !LINTER */?/* END IF */: Node; } " )] @@ -1886,6 +1887,7 @@ pub struct FormalParameters<'a> { parameter: FormalParameter; readonly: boolean; static: boolean; + parent/* IF !LINTER */?/* END IF */: Node; } " )] diff --git a/npm/oxc-types/types.d.ts b/npm/oxc-types/types.d.ts index ef5f12de0ce3d..1914897858b39 100644 --- a/npm/oxc-types/types.d.ts +++ b/npm/oxc-types/types.d.ts @@ -669,6 +669,7 @@ export interface FormalParameterRest extends Span { optional?: boolean; typeAnnotation?: TSTypeAnnotation | null; value?: null; + parent?: Node; } export type FormalParameter = { @@ -683,6 +684,7 @@ export interface TSParameterProperty extends Span { parameter: FormalParameter; readonly: boolean; static: boolean; + parent?: Node; } export interface FunctionBody extends Span {