You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add global scope's implicit field to Scope Manager docs (#19770)
* docs: add global scope's `implicit` field to Scope Manager docs
* Update docs/src/extend/scope-manager-interface.md
Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
---------
Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
Copy file name to clipboardExpand all lines: docs/src/extend/scope-manager-interface.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,26 @@ Those members are defined but not used in ESLint.
133
133
-**Type:**`boolean`
134
134
-**Description:**`true` if this scope is `"function-expression-name"` scope.
135
135
136
+
#### implicit
137
+
138
+
This field exists only in the root `Scope` object (the global scope). It provides information about implicit global variables. Implicit global variables are variables that are neither built-in nor explicitly declared, but created implicitly by assigning values to undeclared variables in non-strict code. `Variable` objects for these variables are not present in the root `Scope` object's fields `variables` and `set`.
139
+
140
+
The value of the `implicit` field is an object with two properties.
141
+
142
+
##### variables
143
+
144
+
-**Type:**`Variable[]`
145
+
-**Description:** The array of all implicit global variables.
146
+
147
+
##### set
148
+
149
+
-**Type:**`Map<string, Variable>`
150
+
-**Description:** The map from variable names to variable objects for implicit global variables.
151
+
152
+
::: tip
153
+
In `Variable` objects that represent implicit global variables, `references` is always an empty array. You can find references to these variables in the `through` field of the root `Scope` object (the global scope), among other unresolved references.
154
+
:::
155
+
136
156
### Deprecated members
137
157
138
158
Those members are defined but not used in ESLint.
@@ -354,7 +374,7 @@ Those members are defined but not used in ESLint.
354
374
|`"CatchClause"`|`CatchClause`|
355
375
|`"ClassName"`|`ClassDeclaration` or `ClassExpression`|
356
376
|`"FunctionName"`|`FunctionDeclaration` or `FunctionExpression`|
0 commit comments