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

fix(lint/noEmptyBlockStatements): fix false positive when considering constructors using property parameters #3009

Conversation

dyc3
Copy link
Contributor

@dyc3 dyc3 commented May 27, 2024

Summary

Typescript has a syntax extension called parameter properties. See: https://www.typescriptlang.org/docs/handbook/2/classes.html#parameter-properties
This PR makes it so that this rule ignores constructors that use this feature.

fixes #3005

Test Plan

Added snapshot test

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels May 27, 2024
Copy link

codspeed-hq bot commented May 27, 2024

CodSpeed Performance Report

Merging #3009 will not alter performance

Comparing dyc3:05-27-fix_lint_noemptyblockstatements_fix_false_positive_when_considering_constructors_using_property_parameters (23d78d5) with main (5e96827)

Summary

✅ 92 untouched benchmarks

@dyc3 dyc3 marked this pull request as draft May 28, 2024 00:19
@dyc3 dyc3 force-pushed the 05-27-fix_lint_noemptyblockstatements_fix_false_positive_when_considering_constructors_using_property_parameters branch 2 times, most recently from ef9e59c to ccaa249 Compare May 28, 2024 00:24
@dyc3 dyc3 marked this pull request as ready for review May 28, 2024 00:42
@dyc3 dyc3 force-pushed the 05-27-fix_lint_noemptyblockstatements_fix_false_positive_when_considering_constructors_using_property_parameters branch from ccaa249 to 8d2c21d Compare May 28, 2024 11:25
@dyc3 dyc3 requested a review from ah-yu May 28, 2024 11:28
Copy link
Member

@Conaclos Conaclos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also exclude empty constructors with a private or a protected accessibility modifier.

@dyc3
Copy link
Contributor Author

dyc3 commented May 28, 2024

I think we should also exclude empty constructors with a private or a protected accessibility modifier.

I'll go ahead and do that in this PR.

@dyc3 dyc3 force-pushed the 05-27-fix_lint_noemptyblockstatements_fix_false_positive_when_considering_constructors_using_property_parameters branch from 8d2c21d to 48716db Compare May 28, 2024 13:07
@github-actions github-actions bot added the A-Changelog Area: changelog label May 28, 2024
@dyc3 dyc3 requested a review from Conaclos May 28, 2024 13:08
@dyc3 dyc3 force-pushed the 05-27-fix_lint_noemptyblockstatements_fix_false_positive_when_considering_constructors_using_property_parameters branch from 48716db to 23d78d5 Compare May 28, 2024 13:16
@dyc3 dyc3 requested a review from Conaclos May 28, 2024 13:16
@Conaclos Conaclos merged commit c52865f into biomejs:main May 28, 2024
12 checks passed
@dyc3 dyc3 deleted the 05-27-fix_lint_noemptyblockstatements_fix_false_positive_when_considering_constructors_using_property_parameters branch May 28, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Linter Area: linter L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

💅 False positive for lint/suspicious/noEmptyBlockStatements with constructor
3 participants