Skip to content

Commit

Permalink
docs: add correct example
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed Sep 23, 2022
1 parent 6e3898c commit c9ae910
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/src/rules/no-implicit-globals.md
Expand Up @@ -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,
Expand Down

0 comments on commit c9ae910

Please sign in to comment.