@@ -62,6 +62,9 @@ There are multiple ways to specify the member types. The most explicit and granu
62
62
" public-static-field" ,
63
63
" protected-static-field" ,
64
64
" private-static-field" ,
65
+ " public-decorated-field" ,
66
+ " protected-decorated-field" ,
67
+ " private-decorated-field" ,
65
68
" public-instance-field" ,
66
69
" protected-instance-field" ,
67
70
" private-instance-field" ,
@@ -78,6 +81,9 @@ There are multiple ways to specify the member types. The most explicit and granu
78
81
" public-static-method" ,
79
82
" protected-static-method" ,
80
83
" private-static-method" ,
84
+ " public-decorated-method" ,
85
+ " protected-decorated-method" ,
86
+ " private-decorated-method" ,
81
87
" public-instance-method" ,
82
88
" protected-instance-method" ,
83
89
" private-instance-method" ,
@@ -99,17 +105,45 @@ It is also possible to group member types by their accessibility (`static`, `ins
99
105
// No accessibility for index signature. See above.
100
106
101
107
// Fields
102
- " public-field" , // = ["public-static-field", "public-instance-field"])
103
- " protected-field" , // = ["protected-static-field", "protected-instance-field"])
104
- " private-field" , // = ["private-static-field", "private-instance-field"])
108
+ " public-field" , // = ["public-static-field", "public-instance-field"]
109
+ " protected-field" , // = ["protected-static-field", "protected-instance-field"]
110
+ " private-field" , // = ["private-static-field", "private-instance-field"]
105
111
106
112
// Constructors
107
113
// Only the accessibility of constructors is configurable. See below.
108
114
109
115
// Methods
110
- " public-method" , // = ["public-static-method", "public-instance-method"])
111
- " protected-method" , // = ["protected-static-method", "protected-instance-method"])
112
- " private-method" // = ["private-static-method", "private-instance-method"])
116
+ " public-method" , // = ["public-static-method", "public-instance-method"]
117
+ " protected-method" , // = ["protected-static-method", "protected-instance-method"]
118
+ " private-method" // = ["private-static-method", "private-instance-method"]
119
+ ]
120
+ ```
121
+
122
+ ### Member group types (with accessibility and a decorator)
123
+
124
+ It is also possible to group methods or fields with a decorator separately, optionally specifying
125
+ their accessibility.
126
+
127
+ ``` jsonc
128
+ [
129
+ // Index signature
130
+ // No decorators for index signature.
131
+
132
+ // Fields
133
+ " public-decorated-field" ,
134
+ " protected-decorated-field" ,
135
+ " private-decorated-field" ,
136
+
137
+ " decorated-field" , // = ["public-decorated-field", "protected-decorated-field", "private-decorated-field"]
138
+
<
9E88
td data-grid-cell-id="diff-76f7820640084772a4df6af9a91b71d64e8e2ec5f1933a727b52317660f47858-112-139-0" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-additionNum-bgColor, var(--diffBlob-addition-bgColor-num));text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative left-side">
139
+ // Constructors
140
+ // There are no decorators for constructors.
141
+
142
+ " public-decorated-method" ,
143
+ " protected-decorated-method" ,
144
+ " private-decorated-method" ,
145
+
146
+ " decorated-method" // = ["public-decorated-method", "protected-decorated-method", "private-decorated-method"]
113
147
]
114
148
```
115
149
@@ -123,17 +157,17 @@ Another option is to group the member types by their scope (`public`, `protected
123
157
// No scope for index signature. See above.
124
158
125
159
// Fields
126
- " static-field" , // = ["public-static-field", "protected-static-field", "private-static-field"])
127
- " instance-field" , // = ["public-instance-field", "protected-instance-field", "private-instance-field"])
128
- " abstract-field" , // = ["public-abstract-field", "protected-abstract-field", "private-abstract-field"])
160
+ " static-field" , // = ["public-static-field", "protected-static-field", "private-static-field"]
161
+ " instance-field" , // = ["public-instance-field", "protected-instance-field", "private-instance-field"]
162
+ " abstract-field" , // = ["public-abstract-field", "protected-abstract-field", "private-abstract-field"]
129
163
130
164
// Constructors
131
- " constructor" , // = ["public-constructor", "protected-constructor", "private-constructor"])
165
+ " constructor" , // = ["public-constructor", "protected-constructor", "private-constructor"]
132
166
133
167
// Methods
134
- " static-method" , // = ["public-static-method", "protected-static-method", "private-static-method"])
135
- " instance-method" , // = ["public-instance-method", "protected-instance-method", "private-instance-method"])
136
- " abstract-method" // = ["public-abstract-method", "protected-abstract-method", "private-abstract-method"])
168
+ " static-method" , // = ["public-static-method", "protected-static-method", "private-static-method"]
169
+ " instance-method" , // = ["public-instance-method", "protected-instance-method", "private-instance-method"]
170
+ " abstract-method" // = ["public-abstract-method", "protected-abstract-method", "private-abstract-method"]
137
171
]
138
172
```
139
173
@@ -148,14 +182,14 @@ The third grouping option is to ignore both scope and accessibility.
148
182
149
183
// Fields
150
184
" field" , // = ["public-static-field", "protected-static-field", "private-static-field", "public-instance-field", "protected-instance-field", "private-instance-field",
151
- // "public-abstract-field", "protected-abstract-field", private-abstract-field"])
185
+ // "public-abstract-field", "protected-abstract-field", private-abstract-field"]
152
186
153
187
// Constructors
154
188
// Only the accessibility of constructors is configurable. See above.
155
189
156
190
// Methods
157
191
" method" // = ["public-static-method", "protected-static-method", "private-static-method", "public-instance-method", "protected-instance-method", "private-instance-method",
158
- // "public-abstract-method", "protected-abstract-method", "private-abstract-method"])
192
+ // "public-abstract-method", "protected-abstract-method", "private-abstract-method"]
159
193
]
160
194
```
161
195
@@ -174,6 +208,10 @@ The default configuration looks as follows:
174
208
" protected-static-field" ,
175
209
" private-static-field" ,
176
210
211
+ " public-decorated-field" ,
212
+ " protected-decorated-field" ,
213
+ " private-decorated-field" ,
214
+
177
215
" public-instance-field" ,
178
216
" protected-instance-field" ,
179
217
" private-instance-field" ,
@@ -190,6 +228,8 @@ The default configuration looks as follows:
190
228
" instance-field" ,
191
229
" abstract-field" ,
192
230
231
+ " decorated-field" ,
232
+
193
233
" field" ,
194
234
195
235
// Constructors
@@ -204,6 +244,10 @@ The default configuration looks as follows:
204
244
" protected-static-method" ,
205
245
" private-static-method" ,
206
246
247
+ " public-decorated-method" ,
248
+ " protected-decorated-method" ,
249
+ " private-decorated-method" ,
250
+
207
251
" public-instance-method" ,
208
252
" protected-instance-method" ,
209
253
" private-instance-method" ,
@@ -220,6 +264,8 @@ The default configuration looks as follows:
220
264
" instance-method" ,
221
265
" abstract-method" ,
222
266
267
+ " decorated-method" ,
268
+
223
269
" method"
224
270
]
225
271
}
@@ -749,7 +795,7 @@ type Foo = {
749
795
750
796
It is possible to sort all members within a group alphabetically.
751
797
752
- #### Configuration: ` { default: { memberTypes: <Default Order>, order: "alphabetically" } } `
798
+ #### Configuration: ` { " default" : { " memberTypes" : <Default Order>, " order" : "alphabetically" } } `
753
799
754
800
This will apply the default order (see above) and enforce an alphabetic order within each group.
755
801
@@ -795,7 +841,7 @@ interface Foo {
795
841
796
842
It is also possible to sort all members and ignore the member groups completely.
797
843
798
- #### Configuration: ` { default: { memberTypes: "never", order: "alphabetically" } } `
844
+ #### Configuration: ` { " default" : { " memberTypes" : "never", " order" : "alphabetically" } } `
799
845
800
846
##### Incorrect example
801
847
0 commit comments