Skip to content

Commit c38783c

Browse files
Copilotweboko
andcommitted
Add ESLint rule to enforce member ordering by access modifiers
Co-authored-by: weboko <[email protected]>
1 parent 6da6884 commit c38783c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.eslintrc.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@
3131
}
3232
],
3333
"@typescript-eslint/explicit-member-accessibility": "error",
34+
"@typescript-eslint/member-ordering": [
35+
"error",
36+
{
37+
"default": [
38+
"static-field",
39+
"static-method",
40+
"public-field",
41+
"public-method",
42+
"private-field",
43+
"private-method"
44+
]
45+
}
46+
],
3447
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
3548
"prettier/prettier": [
3649
"error",

packages/enr/src/enr.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export enum TransportProtocolPerIpVersion {
3232

3333
export class ENR extends RawEnr implements IEnr {
3434
public static readonly RECORD_PREFIX = "enr:";
35-
public peerId?: PeerId;
3635

3736
public static create(
3837
kvs: Record<ENRKey, ENRValue> = {},
@@ -52,6 +51,8 @@ export class ENR extends RawEnr implements IEnr {
5251
return enr;
5352
}
5453

54+
public peerId?: PeerId;
55+
5556
public get nodeId(): NodeId | undefined {
5657
switch (this.id) {
5758
case "v4":

0 commit comments

Comments
 (0)