Add an option to enforce subscription variable names using finnish rule
See original GitHub issueFirst point is that I noticed that the project I’m currently working on has two standards for “Subscription” declarations: one that uses finnish
notation and others that don’t, so I’d like to propose the addition of this option in finnish
rule.
A trivial case that I’m seeing much is the use with @ngrx / component-store
, which generally looks like this:
class MyStore extends ComponentStore<State> {
// `myEffect` is typed as `Subscription`.
readonly myEffect = this.effect(trigger$ => trigger$.pipe())
}
In this case, I’d like to enforce myEffect
to be myEffect$
.
Maybe it could be useful to implements it also in no-finnish
so other teams can avoid this notation even for Subscription
.
The second point is another thing that I also noticed that sometimes the finnish
notation is misused, for example in places that do not use Observables or something like that, but I don’t know if it’s in the scope of this rule.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
I don’t think this makes sense. A component store effect is just a method that returns a
void
or aSubscription
, the return type of the attached snipped would beconst myEffect: () => void
.In 3.1.0, the
finnish
rule now has astrict
option that will effect failures for non-Observable
identifiers that have a$
suffix.