I've got this code:
export class RouteParamsService {
private routeParamsChangeSource = new ReplaySubject<Params>() // lets call this line 1
routeParamsChange$ = this.routeParamsChangeSource.asObservable() // lets call this line 2
... etc
}
If I put line 1 before line 2 I get the error:
@typescript-eslint/member-ordering Member routeParamsChange$ should be declared before all private instance field definitions
If I put line 2 before line 1 I get the error:
Property routeParamsChangeSource is used before its initialisation
I understand both errors and why I am getting them. However, is there a rule that will relax the rules BUT ONLY when you end up in a trap like this? I know I can do eslint-disable-line @typescript-eslint/member-ordering but I don't want to have to do this everytime I hit this issue (which I am hitting a lot).
I also DO NOT want to make routeParamsChangeSource public.
Any ideas? thanks