Skip to content

Parameter decorators are dropped #172

Description

@zloirock
class Foo { constructor(@inject(dep) foo: string) {} }

prints

class Foo {
	constructor(foo: string) {}
}

No parameter printer consults node.decorators. Decorators run user code, so this is a runtime behavior change, not formatting.

Context: found by a parse -> print -> reparse structural gate over a ~8.5k-file TS/JS corpus while adopting esrap in core-js's build plugin, then re-verified in isolation. esrap 2.3.5; the ASTs below come from @typescript-eslint/typescript-estree 8.67 with loc/range enabled, so the repros are independent of our own (oxc-based) pipeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions