From c9ae910c97e02ba663704b9470d5d2a670cc6bac Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Sat, 24 Sep 2022 03:02:59 +0900 Subject: [PATCH] docs: add correct example --- docs/src/rules/no-implicit-globals.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/src/rules/no-implicit-globals.md b/docs/src/rules/no-implicit-globals.md index 37320393ac4a..45f23638b23d 100644 --- a/docs/src/rules/no-implicit-globals.md +++ b/docs/src/rules/no-implicit-globals.md @@ -260,6 +260,16 @@ window.MyGlobalFunction = (function() { 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,