Undeclared variables check

This plugin throws errors on references to undeclared variables.

Example

In

function foo() {}
foo();
bar();

Out

ReferenceError: stdin: Line 3: Reference to undeclared variable "bar" - did you mean "foo"?
  1 | function foo() {}
  2 | foo();
> 3 | bar();
    | ^
  4 |

Installation

$ npm install babel-plugin-undeclared-variables-check

Usage

Add the following line to your .babelrc file:

{
  "plugins": ["undeclared-variables-check"]
}