Skip to content

Commit

Permalink
Docs: Add documentation for /* exported */ (fixes #7998) (#8065)
Browse files Browse the repository at this point in the history
Added information about using line comment and a code example for
correct usage.
  • Loading branch information
leeyimin authored and gyandeeps committed Feb 11, 2017
1 parent fcc38db commit 6445d2a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/rules/no-unused-vars.md
Expand Up @@ -90,6 +90,16 @@ Note that `/* exported */` has no effect for any of the following:
* when `parserOptions.sourceType` is `module`
* when `ecmaFeatures.globalReturn` is `true`

The line comment `// exported variableName` will not work as `exported` is not line-specific.

Examples of **correct** code for `/* exported variableName */` operation:

```js
/* exported global_var */

var global_var = 42;
```

## Options

This rule takes one argument which can be a string or an object. The string settings are the same as those of the `vars` property (explained below).
Expand Down

0 comments on commit 6445d2a

Please sign in to comment.