lib/rules/no-unused-vars.js
function inspectProgram(emitted) {

            if (emitted.exit) {
                Object.keys(allVariableDeclarations).forEach(function(name) {
                    context.report({
                        node: allVariableDeclarations [name],
                        message: "Variable '" + name + "' is declared but never used."
                    });
                });
            }

        }
function inspectProgram(emitted) {

            if (emitted.exit) {
                Object.keys(allVariableDeclarations).forEach(function(name) {
                    context.report({
                        node: allVariableDeclarations [name],
                        message: "Variable '" + name + "' is declared but never used."
                    });
                });
            }

        }
function inspectProgram ( emitted ) { if ( emitted . exit ) { Object . keys ( allVariableDeclarations ) . forEach ( function ( name ) { context . report ( { node : allVariableDeclarations [ name ] , message : "Variable '" + name + "' is declared but never used." } ) ; } ) ; } }
While exiting Progam Node, all the vars that haven't been used still exist inside VariableDeclarations. Report them
While exiting Progam Node all the vars that haven t been used still exist inside VariableDeclarations . Report them