Add protected
to no-exposed-subject
eslint rule
#89
Locked
butterknight
started this conversation in
General
Replies: 2 comments 6 replies
-
We use protected when we have class inheritance. I think that the proper way would be to have:
This approach has a bit of a boilerplate, but I think it is "by the book" solution. |
Beta Was this translation helpful? Give feedback.
3 replies
-
I vote for leaving it private-only |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey!
The
no-exposed-subjects
rule by default (when turned on) requiresSubject
s to always be private. Its documentation states that it can be configured to allow them to be protected as well. The use-case for this are abstract classes that could expose a subject to its inheriting classes.The downside of this is that, with the new version of Angular, protected members can be accessed from the template so it could be a potential risk.
Do you think it might be beneficial enough to allow protected with this rule or should we leave it only for private as it is currently?
Beta Was this translation helpful? Give feedback.
All reactions