no-use-before-define

- Disallow the use of variables before they are defined

This rule will warn when it encounters a reference to an identifier that has not yet been declared.

What ESLint should do when it catches the rule break

Show a warning

Options

functions

Checks function declarations.

classes

Checks class declarations.

variables

Checks variable declarations.

Rule examples

You can check them out here.