Skip to content

refactor: make class members readonly when possible#3227

Merged
tbouffard merged 2 commits into
masterfrom
chore/mark_class_members_as_readonly_when_possible
Dec 11, 2024
Merged

refactor: make class members readonly when possible#3227
tbouffard merged 2 commits into
masterfrom
chore/mark_class_members_as_readonly_when_possible

Conversation

@tbouffard

Copy link
Copy Markdown
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
@github-actions

github-actions Bot commented Dec 11, 2024

Copy link
Copy Markdown

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

🤖 By surge-preview

@github-actions

github-actions Bot commented Dec 11, 2024

Copy link
Copy Markdown

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

🤖 By surge-preview

@sonarqubecloud

Copy link
Copy Markdown

@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
@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