Skip to content

override keyword gets removed for members in constructor #11017

@Flarna

Description

@Flarna

Prettier 2.3.1
Playground link

--parser typescript

Input:

class B {
  constructor(protected readonly config: { a: string }) {}
}

class D extends B {
  constructor(protected override readonly config: { a: string; b: number }) {
    super(config);
  }
}

Output:

class B {
  constructor(protected readonly config: { a: string }) {}
}

class D extends B {
  constructor(protected readonly config: { a: string; b: number }) {
    super(config);
  }
}

Expected behavior:
override keyword should be preserved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.scope:dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependency

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions