Skip to content

Commit

Permalink
Docs: added fn decl example and details for variables option
Browse files Browse the repository at this point in the history
  • Loading branch information
anikethsaha committed Mar 7, 2020
1 parent fd8e1f5 commit ddd7a2f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/rules/no-use-before-define.md
Expand Up @@ -76,13 +76,13 @@ function g() {
Class declarations are not hoisted, so it might be danger.
Default is `true`.
* `variables` (`boolean`) -
This flag determines whether or not the rule checks variable declarations in upper scopes.
This flag determines whether or not the rule checks variable and function (arrow functions) declarations in upper scopes.
If this is `true`, the rule warns every reference to a variable before the variable declaration.
Otherwise, the rule ignores a reference if the declaration is in an upper scope, while still reporting the reference if it's in the same scope as the declaration.
Default is `true`.

This rule accepts `"nofunc"` string as an option.
`"nofunc"` is the same as `{ "functions": false, "classes": true }`.
`"nofunc"` is the same as `{ "functions": false }`.

### functions

Expand Down Expand Up @@ -143,4 +143,10 @@ function baz() {
}

var foo = 1;


const a = () => b(); // ok

const b = () => {};

```

0 comments on commit ddd7a2f

Please sign in to comment.