Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

Commit 33504c2

Browse files
committed
🔧 (tslint) configure member-ordering
1 parent efe6029 commit 33504c2

5 files changed

Lines changed: 33 additions & 19 deletions

File tree

src/Navigation/BackHandlerDelegate.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ export class BackHandlerDelegate {
1919
BackHandlerDelegate.addEventListener
2020
);
2121

22-
// tslint:disable-next-line:member-ordering
2322
defaultBackContext = { back$: this.back$ };
2423
}

src/Navigation/Navigation.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ export class Navigation {
99
Navigation.singleton = new Navigation();
1010
return Navigation.singleton;
1111
}
12-
private static singleton: Navigation;
1312

14-
fullScreenDelegate = new FullScreenDelegate();
13+
private constructor() {}
14+
private static singleton: Navigation;
1515

1616
backHandlerDelegate = new BackHandlerDelegate();
1717

18-
private constructor() {}
18+
fullScreenDelegate = new FullScreenDelegate();
1919
}

src/Navigation/Stop.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ComponentType } from 'react';
22

33
export interface IStop {
4-
name: string;
54
Component: ComponentType;
65
isFullScreen?: boolean;
6+
name: string;
77
}

src/createCanal.tsx

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ export const createCanal = <
4747
class CanalComponent extends ReactComponent<
4848
CanalComponentProps<Authorizations>
4949
> {
50+
constructor(props: CanalComponentProps<Authorizations>) {
51+
super(props);
52+
const { style, ...nextAuthorizations } = props;
53+
/**
54+
* @TODO 19-06-01 Find a way to safely forbid the use of reserved prop `style` in a StopName.
55+
*/
56+
// @ts-ignore
57+
this.authorizations$.next(nextAuthorizations);
58+
Navigation.instance.fullScreenDelegate.canalsFullScreenStackProperties$.next(
59+
this.fullScreenStackProperties$
60+
);
61+
}
5062
static defaultProps = {
5163
style: StyleSheet.absoluteFill
5264
};
@@ -99,19 +111,6 @@ export const createCanal = <
99111
)
100112
);
101113

102-
constructor(props: CanalComponentProps<Authorizations>) {
103-
super(props);
104-
const { style, ...nextAuthorizations } = props;
105-
/**
106-
* @TODO 19-06-01 Find a way to safely forbid the use of reserved prop `style` in a StopName.
107-
*/
108-
// @ts-ignore
109-
this.authorizations$.next(nextAuthorizations);
110-
Navigation.instance.fullScreenDelegate.canalsFullScreenStackProperties$.next(
111-
this.fullScreenStackProperties$
112-
);
113-
}
114-
115114
shouldComponentUpdate({
116115
style,
117116
...nextAuthorizations

tslint.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,23 @@
99
"no-empty-interface": false,
1010
"member-access": false,
1111
"arrow-parens": false,
12-
"semicolon": false
12+
"semicolon": false,
13+
"member-ordering": [
14+
true,
15+
{
16+
"order": [
17+
"private-constructor",
18+
"public-constructor",
19+
"private-static-field",
20+
"public-static-field",
21+
"private-instance-field",
22+
"public-instance-field",
23+
"private-instance-method",
24+
"protected-instance-method",
25+
"public-instance-method"
26+
]
27+
}
28+
]
1329
},
1430
"rulesDirectory": [],
1531
"linterOptions": {

0 commit comments

Comments
 (0)