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

refactor: make class members readonly when possible #3227

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

tbouffard
Copy link
Member

Make the members readonly when they are not reassigned outside the constructor. This improves type safety and promotes immutability.

This has been detected by SonarCloud. Use the related typescript-eslint rule to prevent this from appearing again.
The eslint errors are auto-fixable, so this change will be transparent for developers.

Notes

See https://typescript-eslint.io/rules/prefer-readonly/

Make the members readonly when they are not reassigned outside the constructor. This improves type safety and promotes
immutability.

This has been detected by SonarCloud. Use the related typescript-eslint rule to prevent this from appearing again.
The eslint errors are auto-fixable, so this change will be transparent for developers.
@tbouffard tbouffard added the refactoring Code refactoring label Dec 11, 2024
Copy link

github-actions bot commented Dec 11, 2024

♻️ PR Preview 4f51a03 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

Copy link

github-actions bot commented Dec 11, 2024

♻️ PR Preview 4f51a03 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@tbouffard tbouffard marked this pull request as ready for review December 11, 2024 12:48
@tbouffard tbouffard requested a review from csouchet December 11, 2024 12:53
@tbouffard tbouffard merged commit ff0b4c5 into master Dec 11, 2024
27 checks passed
@tbouffard tbouffard deleted the chore/mark_class_members_as_readonly_when_possible branch December 11, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Code refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants