Skip to content

Commit

Permalink
fix(eslint-plugin): Support private fields (#4182)
Browse files Browse the repository at this point in the history
  • Loading branch information
sviat9440 authored and Святослав Зайцев committed Oct 24, 2022
1 parent d14591c commit 10ff764
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 @@ -49,7 +49,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 @@ -65,11 +65,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 @@ -78,14 +80,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 @@ -109,6 +112,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 @@ -117,14 +121,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 @@ -138,6 +143,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 @@ -146,14 +152,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 @@ -167,6 +174,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 @@ -175,14 +183,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 @@ -902,15 +911,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 @@ -924,6 +950,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 @@ -932,14 +959,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 @@ -953,6 +981,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 @@ -961,10 +990,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 @@ -982,15 +1011,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 10ff764

Please sign in to comment.