no-undef

- Disallow the use of undeclared variables unless mentioned in /*global */ comments

Recommended

Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment, or specified in the globals key in the configuration file. A common use case for these is if you intentionally use globals that are defined elsewhere (e.g. in a script sourced from HTML).

What ESLint should do when it catches the rule break

Show a warning

Options

typeof

Warns for variables used inside typeof check.

Rule examples

You can check them out here.