Skip to content

Commit

Permalink
fix(eslint-plugin): [member-ordering] support private fields (#5859)
Browse files Browse the repository at this point in the history
Co-authored-by: Святослав Зайцев <sz@agentapp.ru>
  • Loading branch information
sviat9440 and Святослав Зайцев committed Nov 25, 2022
1 parent ee62b0b commit f02761a
Show file tree
Hide file tree
Showing 3 changed files with 351 additions and 50 deletions.
50 changes: 40 additions & 10 deletions packages/eslint-plugin/docs/rules/member-ordering.md
Expand Up @@ -54,7 +54,7 @@ The `OrderConfig` settings for each kind of construct may configure sorting on o
You can define many different groups based on different attributes of members.
The supported member attributes are, in order:

- **Accessibility** (`'public' | 'protected' | 'private'`)
- **Accessibility** (`'public' | 'protected' | 'private' | '#private'`)
- **Decoration** (`'decorated'`): Whether the member has an explicit accessibility decorator
- **Kind** (`'call-signature' | 'constructor' | 'field' | 'get' | 'method' | 'set' | 'signature'`)

Expand All @@ -81,11 +81,13 @@ The default configuration looks as follows:
"default": [
// Index signature
"signature",
"call-signature",

// Fields
"public-static-field",
"protected-static-field",
"private-static-field",
"#private-static-field",

"public-decorated-field",
"protected-decorated-field",
Expand All @@ -94,14 +96,15 @@ The default configuration looks as follows:
"public-instance-field",
"protected-instance-field",
"private-instance-field",
"#private-instance-field",

"public-abstract-field",
"protected-abstract-field",
"private-abstract-field",

"public-field",
"protected-field",
"private-field",
"#private-field",

"static-field",
"instance-field",
Expand All @@ -125,6 +128,7 @@ The default configuration looks as follows:
"public-static-get",
"protected-static-get",
"private-static-get",
"#private-static-get",

"public-decorated-get",
"protected-decorated-get",
Expand All @@ -133,14 +137,15 @@ The default configuration looks as follows:
"public-instance-get",
"protected-instance-get",
"private-instance-get",
"#private-instance-get",

"public-abstract-get",
"protected-abstract-get",
"private-abstract-get",

"public-get",
"protected-get",
"private-get",
"#private-get",

"static-get",
"instance-get",
Expand All @@ -154,6 +159,7 @@ The default configuration looks as follows:
"public-static-set",
"protected-static-set",
"private-static-set",
"#private-static-set",

"public-decorated-set",
"protected-decorated-set",
Expand All @@ -162,14 +168,15 @@ The default configuration looks as follows:
"public-instance-set",
"protected-instance-set",
"private-instance-set",
"#private-instance-set",

"public-abstract-set",
"protected-abstract-set",
"private-abstract-set",

"public-set",
"protected-set",
"private-set",
"#private-set",

"static-set",
"instance-set",
Expand All @@ -183,6 +190,7 @@ The default configuration looks as follows:
"public-static-method",
"protected-static-method",
"private-static-method",
"#private-static-method",

"public-decorated-method",
"protected-decorated-method",
Expand All @@ -191,14 +199,15 @@ The default configuration looks as follows:
"public-instance-method",
"protected-instance-method",
"private-instance-method",
"#private-instance-method",

"public-abstract-method",
"protected-abstract-method",
"private-abstract-method",

"public-method",
"protected-method",
"private-method",
"#private-method",

"static-method",
"instance-method",
Expand Down Expand Up @@ -918,15 +927,32 @@ The most explicit and granular form is the following:
"public-static-field",
"protected-static-field",
"private-static-field",
"#private-static-field",

"public-decorated-field",
"protected-decorated-field",
"private-decorated-field",

"public-instance-field",
"protected-instance-field",
"private-instance-field",
"#private-instance-field",

"public-abstract-field",
"protected-abstract-field",
"private-abstract-field",

"public-field",
"protected-field",
"private-field",
"#private-field",

"static-field",
"instance-field",
"abstract-field",

"decorated-field",

"field",

// Static initialization
"static-initialization",
Expand All @@ -940,6 +966,7 @@ The most explicit and granular form is the following:
"public-static-get",
"protected-static-get",
"private-static-get",
"#private-static-get",

"public-decorated-get",
"protected-decorated-get",
Expand All @@ -948,14 +975,15 @@ The most explicit and granular form is the following:
"public-instance-get",
"protected-instance-get",
"private-instance-get",
"#private-instance-get",

"public-abstract-get",
"protected-abstract-get",
"private-abstract-get",

"public-get",
"protected-get",
"private-get",
"#private-get",

"static-get",
"instance-get",
Expand All @@ -969,6 +997,7 @@ The most explicit and granular form is the following:
"public-static-set",
"protected-static-set",
"private-static-set",
"#private-static-set",

"public-decorated-set",
"protected-decorated-set",
Expand All @@ -977,10 +1006,10 @@ The most explicit and granular form is the following:
"public-instance-set",
"protected-instance-set",
"private-instance-set",
"#private-instance-set",

"public-abstract-set",
"protected-abstract-set",
"private-abstract-set",

"public-set",
"protected-set",
Expand All @@ -998,15 +1027,16 @@ The most explicit and granular form is the following:
"public-static-method",
"protected-static-method",
"private-static-method",
"#private-static-method",
"public-decorated-method",
"protected-decorated-method",
"private-decorated-method",
"public-instance-method",
"protected-instance-method",
"private-instance-method",
"#private-instance-method",
"public-abstract-method",
"protected-abstract-method",
"private-abstract-method"
"protected-abstract-method"
]
```

Expand Down

0 comments on commit f02761a

Please sign in to comment.