Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override keyword gets removed for members in constructor #11017

Closed
Flarna opened this issue Jun 5, 2021 · 4 comments · Fixed by #11074
Closed

override keyword gets removed for members in constructor #11017

Flarna opened this issue Jun 5, 2021 · 4 comments · Fixed by #11074
Labels
lang:typescript Issues affecting TypeScript-specific constructs (not general JS issues) locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency type:bug Issues identifying ugly output, or a defect in the program

Comments

@Flarna
Copy link

Flarna commented Jun 5, 2021

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.

@sosukesuzuki sosukesuzuki added lang:typescript Issues affecting TypeScript-specific constructs (not general JS issues) type:bug Issues identifying ugly output, or a defect in the program scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency labels Jun 6, 2021
@Flarna
Copy link
Author

Flarna commented Jun 17, 2021

Thanks a lot for the fix!
May I ask if there is a new release planed which includes this?

@sosukesuzuki
Copy link
Member

We did not plan for this, but I think this is an important bug and we should release it 👍

@sosukesuzuki
Copy link
Member

@Flarna Sorry for delay, I've published Prettier 2.3.2 that supports override modifier for parameter properties!

@github-actions github-actions bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Sep 25, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang:typescript Issues affecting TypeScript-specific constructs (not general JS issues) locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants