Skip to content

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

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

@sonarqubecloud
Copy link

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

3 participants