lib/rules/no-unused-vars.js
function inspectIdentifier(emitted) {
            if (!emitted.exit) {
                let node = emitted.node,
                    sourceCode = context.getSourceCode();

                if (
                    allVariableDeclarations [node.name] &&
					sourceCode.getParent(node).type !== "VariableDeclarator"
                ) {
                    delete allVariableDeclarations [node.name];
                }
            }
        }
function inspectIdentifier(emitted) {
            if (!emitted.exit) {
                let node = emitted.node,
                    sourceCode = context.getSourceCode();

                if (
                    allVariableDeclarations [node.name] &&
					sourceCode.getParent(node).type !== "VariableDeclarator"
                ) {
                    delete allVariableDeclarations [node.name];
                }
            }
        }
As soon as the first use of a variable is encountered, delete that variable's node from allVariableDeclarations