]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/docs/src/rules/no-implicit-globals.md
import 8.41.0 source
[pve-eslint.git] / eslint / docs / src / rules / no-implicit-globals.md
index 15c03861d55e1cb245901648ba389aab2d164019..1e5c5fad723f20a2008421394afa42eb00480133 100644 (file)
@@ -1,10 +1,10 @@
 ---
 title: no-implicit-globals
-layout: doc
 rule_type: suggestion
 related_rules:
 - no-undef
 - no-global-assign
+- no-unused-vars
 further_reading:
 - https://benalman.com/news/2010/11/immediately-invoked-function-expression/
 - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Undeclared_var
@@ -122,8 +122,8 @@ A read-only global variable can be a built-in ES global (e.g. `Array`), an envir
 (e.g. `window` in the browser environment), or a global variable defined as `readonly` in the configuration file
 or in a `/*global */` comment.
 
-* [Specifying Environments](../user-guide/configuring#specifying-environments)
-* [Specifying Globals](../user-guide/configuring#specifying-globals)
+* [Specifying Environments](../use/configure#specifying-environments)
+* [Specifying Globals](../use/configure#specifying-globals)
 
 Examples of **incorrect** code for this rule:
 
@@ -255,6 +255,22 @@ window.MyGlobalFunction = (function() {
 
 :::
 
+### exported
+
+You can use `/* exported variableName */` block comments in the same way as in [`no-unused-vars`](./no-unused-vars). See the [`no-unused-vars` exported section](./no-unused-vars#exported) for details.
+
+Examples of **correct** code for `/* exported variableName */` operation:
+
+::: correct
+
+```js
+/* exported global_var */
+
+var global_var = 42;
+```
+
+:::
+
 ## When Not To Use It
 
 In the case of a browser script, if you want to be able to explicitly declare variables and functions in the global scope,