@@ -97,6 +97,50 @@ Get the proper location of a given function node to report.
97
97
^^^^^^^^^^^^^^
98
98
- `class A { static set foo(a) {} }`
99
99
^^^^^^^^^^^^^^
100
+ - `class A { #foo() {} }`
101
+ ^^^^
102
+ - `class A { *#foo() {} }`
103
+ ^^^^^
104
+ - `class A { async #foo() {} }`
105
+ ^^^^^^^^^^
106
+ - `class A { get #foo() {} }`
107
+ ^^^^^^^^
108
+ - `class A { set #foo(a) {} }`
109
+ ^^^^^^^^
110
+ - `class A { static #foo() {} }`
111
+ ^^^^^^^^^^^
112
+ - `class A { static *#foo() {} }`
113
+ ^^^^^^^^^^^^
114
+ - `class A { static async #foo() {} }`
115
+ ^^^^^^^^^^^^^^^^^
116
+ - `class A { static get #foo() {} }`
117
+ ^^^^^^^^^^^^^^^
118
+ - `class A { static set #foo(a) {} }`
119
+ ^^^^^^^^^^^^^^^
120
+ - `class A { foo = function() {} }`
121
+ ^^^^^^^^^^^^^^
122
+ - `class A { foo = function*() {} }`
123
+ ^^^^^^^^^^^^^^^
124
+ - `class A { foo = async function() {} }`
125
+ ^^^^^^^^^^^^^^^^^^^^
126
+ - `class A { static foo = function() {} }`
127
+ ^^^^^^^^^^^^^^^^^^^^^
128
+ - `class A { static foo = function*() {} }`
129
+ ^^^^^^^^^^^^^^^^^^^^^^
130
+ - `class A { static foo = async function() {} }`
131
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
132
+ - `class A { #foo = function() {} }`
133
+ ^^^^^^^^^^^^^^^
134
+ - `class A { #foo = function*() {} }`
135
+ ^^^^^^^^^^^^^^^^
136
+ - `class A { #foo = async function() {} }`
137
+ ^^^^^^^^^^^^^^^^^^^^^
138
+ - `class A { static #foo = function() {} }`
139
+ ^^^^^^^^^^^^^^^^^^^^^^
140
+ - `class A { static #foo = function*() {} }`
141
+ ^^^^^^^^^^^^^^^^^^^^^^^
142
+ - `class A { static #foo = async function() {} }`
143
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100
144
```
101
145
102
146
</details >
@@ -148,58 +192,74 @@ Get the name and kind of a given function node.
148
192
<details ><summary >Show the name and kind examples:</summary >
149
193
150
194
```
151
- - `function foo() {}` .................... `function 'foo'`
152
- - `(function foo() {})` .................. `function 'foo'`
153
- - `(function() {})` ...................... `function`
154
- - `function* foo() {}` ................... `generator function 'foo'`
155
- - `(function* foo() {})` ................. `generator function 'foo'`
156
- - `(function*() {})` ..................... `generator function`
157
- - `() => {}` ............................. `arrow function`
158
- - `async () => {}` ....................... `async arrow function`
159
- - `const foo = () => {}` ................. `arrow function 'foo'`
160
- - `const foo = async () => {}` ........... `async arrow function 'foo'`
161
- - `foo = () => {}` ....................... `arrow function 'foo'`
162
- - `foo = async () => {}` ................. `async arrow function 'foo'`
163
- - `const foo = function() {}` ............ `function 'foo'`
164
- - `const foo = function* () {}` .......... `generator function 'foo'`
165
- - `const foo = async function() {}` ...... `async function 'foo'`
166
- - `foo = function() {}` .................. `function 'foo'`
167
- - `foo = function* () {}` ................ `generator function 'foo'`
168
- - `foo = async function() {}` ............ `async function 'foo'`
169
- - `({ foo: function foo() {} })` ......... `method 'foo'`
170
- - `({ foo: function() {} })` ............. `method 'foo'`
171
- - `({ ['foo']: function() {} })` ......... `method 'foo'`
172
- - `({ [foo]: function() {} })` ........... `method`
173
- - `({ foo() {} })` ....................... `method 'foo'`
174
- - `({ foo: function* foo() {} })` ........ `generator method 'foo'`
175
- - `({ foo: function*() {} })` ............ `generator method 'foo'`
176
- - `({ ['foo']: function*() {} })` ........ `generator method 'foo'`
177
- - `({ [foo]: function*() {} })` .......... `generator method`
178
- - `({ *foo() {} })` ...................... `generator method 'foo'`
179
- - `({ foo: async function foo() {} })` ... `async method 'foo'`
180
- - `({ foo: async function() {} })` ....... `async method 'foo'`
181
- - `({ ['foo']: async function() {} })` ... `async method 'foo'`
182
- - `({ [foo]: async function() {} })` ..... `async method`
183
- - `({ async foo() {} })` ................. `async method 'foo'`
184
- - `({ get foo() {} })` ................... `getter 'foo'`
185
- - `({ set foo(a) {} })` .................. `setter 'foo'`
186
- - `class A { constructor() {} }` ......... `constructor`
187
- - `class A { foo() {} }` ................. `method 'foo'`
188
- - `class A { *foo() {} }` ................ `generator method 'foo'`
189
- - `class A { async foo() {} }` ........... `async method 'foo'`
190
- - `class A { ['foo']() {} }` ............. `method 'foo'`
191
- - `class A { *['foo']() {} }` ............ `generator method 'foo'`
192
- - `class A { async ['foo']() {} }` ....... `async method 'foo'`
193
- - `class A { [foo]() {} }` ............... `method`
194
- - `class A { *[foo]() {} }` .............. `generator method`
195
- - `class A { async [foo]() {} }` ......... `async method`
196
- - `class A { get foo() {} }` ............. `getter 'foo'`
197
- - `class A { set foo(a) {} }` ............ `setter 'foo'`
198
- - `class A { static foo() {} }` .......... `static method 'foo'`
199
- - `class A { static *foo() {} }` ......... `static generator method 'foo'`
200
- - `class A { static async foo() {} }` .... `static async method 'foo'`
201
- - `class A { static get foo() {} }` ...... `static getter 'foo'`
202
- - `class A { static set foo(a) {} }` ..... `static setter 'foo'`
195
+ - `function foo() {}` ............................... `function 'foo'`
196
+ - `(function foo() {})` ............................. `function 'foo'`
197
+ - `(function() {})` ................................. `function`
198
+ - `function* foo() {}` .............................. `generator function 'foo'`
199
+ - `(function* foo() {})` ............................ `generator function 'foo'`
200
+ - `(function*() {})` ................................ `generator function`
201
+ - `() => {}` ........................................ `arrow function`
202
+ - `async () => {}` .................................. `async arrow function`
203
+ - `const foo = () => {}` ............................ `arrow function 'foo'`
204
+ - `const foo = async () => {}` ...................... `async arrow function 'foo'`
205
+ - `foo = () => {}` .................................. `arrow function 'foo'`
206
+ - `foo = async () => {}` ............................ `async arrow function 'foo'`
207
+ - `const foo = function() {}` ....................... `function 'foo'`
208
+ - `const foo = function* () {}` ..................... `generator function 'foo'`
209
+ - `const foo = async function() {}` ................. `async function 'foo'`
210
+ - `foo = function() {}` ............................. `function 'foo'`
211
+ - `foo = function* () {}` ........................... `generator function 'foo'`
212
+ - `foo = async function() {}` ....................... `async function 'foo'`
213
+ - `({ foo: function foo() {} })` .................... `method 'foo'`
214
+ - `({ foo: function() {} })` ........................ `method 'foo'`
215
+ - `({ ['foo']: function() {} })` .................... `method 'foo'`
216
+ - `({ [foo]: function() {} })` ...................... `method`
217
+ - `({ foo() {} })` .................................. `method 'foo'`
218
+ - `({ foo: function* foo() {} })` ................... `generator method 'foo'`
219
+ - `({ foo: function*() {} })` ....................... `generator method 'foo'`
220
+ - `({ ['foo']: function*() {} })` ................... `generator method 'foo'`
221
+ - `({ [foo]: function*() {} })` ..................... `generator method`
222
+ - `({ *foo() {} })` ................................. `generator method 'foo'`
223
+ - `({ foo: async function foo() {} })` .............. `async method 'foo'`
224
+ - `({ foo: async function() {} })` .................. `async method 'foo'`
225
+ - `({ ['foo']: async function() {} })` .............. `async method 'foo'`
226
+ - `({ [foo]: async function() {} })` ................ `async method`
227
+ - `({ async foo() {} })` ............................ `async method 'foo'`
228
+ - `({ get foo() {} })` .............................. `getter 'foo'`
229
+ - `({ set foo(a) {} })` ............................. `setter 'foo'`
230
+ - `class A { constructor() {} }` .................... `constructor`
231
+ - `class A { foo() {} }` ............................ `method 'foo'`
232
+ - `class A { *foo() {} }` ........................... `generator method 'foo'`
233
+ - `class A { async foo() {} }` ...................... `async method 'foo'`
234
+ - `class A { ['foo']() {} }` ........................ `method 'foo'`
235
+ - `class A { *['foo']() {} }` ....................... `generator method 'foo'`
236
+ - `class A { async ['foo']() {} }` .................. `async method 'foo'`
237
+ - `class A { [foo]() {} }` .......................... `method`
238
+ - `class A { *[foo]() {} }` ......................... `generator method`
239
+ - `class A { async [foo]() {} }` .................... `async method`
240
+ - `class A { get foo() {} }` ........................ `getter 'foo'`
241
+ - `class A { set foo(a) {} }` ....................... `setter 'foo'`
242
+ - `class A { static foo() {} }` ..................... `static method 'foo'`
243
+ - `class A { static *foo() {} }` .................... `static generator method 'foo'`
244
+ - `class A { static async foo() {} }` ............... `static async method 'foo'`
245
+ - `class A { static get foo() {} }` ................. `static getter 'foo'`
246
+ - `class A { static set foo(a) {} }` ................ `static setter 'foo'`
247
+ - `class A { #foo() {} }` ........................... `private method '#foo'`
248
+ - `class A { *#foo() {} }` .......................... `private generator method '#foo'`
249
+ - `class A { async #foo() {} }` ..................... `private async method '#foo'`
250
+ - `class A { get #foo() {} }` ....................... `private getter '#foo'`
251
+ - `class A { set #foo(a) {} }` ...................... `private setter '#foo'`
252
+ - `class A { static #foo() {} }` .................... `private static method '#foo'`
253
+ - `class A { static *#foo() {} }` ................... `private static generator method '#foo'`
254
+ - `class A { static async #foo() {} }` .............. `private static async method '#foo'`
255
+ - `class A { static get #foo() {} }` ................ `private static getter '#foo'`
256
+ - `class A { static set #foo(a) {} }` ............... `private static setter '#foo'`
257
+ - `class A { #foo = function() {} }` ................ `private method '#foo'"`
258
+ - `class A { #foo = function*() {} }` ............... `private generator method '#foo'"`
259
+ - `class A { #foo = async function() {} }` .......... `private async method '#foo'"`
260
+ - `class A { static #foo = function() {} }` ......... `private static method '#foo'"`
261
+ - `class A { static #foo = function*() {} }` ........ `private static generator method '#foo'"`
262
+ - `class A { static #foo = async function() {} }` ... `private static async method '#foo'"`
203
263
```
204
264
205
265
</details >
@@ -252,7 +312,7 @@ If the node is a computed property, this tries to compute the property name by t
252
312
253
313
Name | Type | Description
254
314
:-----|:-----|:------------
255
- node | Node | The node to get that name. This shuld be any of ` MemberExpression ` , ` Property ` , and ` MethodDefinition ` node.
315
+ node | Node | The node to get that name. This shuld be any of ` MemberExpression ` , ` Property ` , ` MethodDefinition ` , and ` PropertyDefinition ` node.
256
316
initialScope | Scope or undefined | Optional. The scope object to find variables.
257
317
258
318
### Return value
@@ -385,6 +445,7 @@ The side effect means that it *may* modify a certain variable or object member.
385
445
- ` MemberExpression ` (` [computed = true] ` )
386
446
- ` MethodDefinition ` (` [computed = true] ` )
387
447
- ` Property ` (` [computed = true] ` )
448
+ - ` PropertyDefinition ` (` [computed = true] ` )
388
449
- ` UnaryExpression ` (` [operator = "-" | "+" | "!" | "~"] ` )
389
450
390
451
### Parameters
0 commit comments