Use # instead of private for private class members
Problem to solve
Throughout the project, we've got a few classes that use private
keyword to mark private class members. This is TypeScript-specific syntax that was created before the #
prefix was generally available in ES.
Now that private class members (#
prefix) are part of ES, we can deprecate the TS-specific private
.
Two advantages:
- private access is enforced at runtime (
private
keywords is removed during TS compilation) - Every usage of the private member makes it obvious that the member is private thanks to the always-present
#
prefix
Proposal
- replace
private
with#
- introduce
eslint
rule to enforce this rule going forward
draft MR !934 (closed)