Use of var instead of let/const
Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 2 points from that category, once per scan, no matter how many places it turns up.
What it detects
`var` has function-scoping footguns; modern JS/TS should use let/const.
Why it matters
var is function-scoped and hoisted, so a variable declared inside a block leaks outside it and reads as undefined before its declaration line. Both behaviors produce bugs that only appear under specific execution orders, classically a loop variable captured by callbacks.
How to fix it
Replace var with const where the binding is never reassigned and let where it is; ESLint's no-var rule with --fix does this mechanically and prefer-const tightens the result. Give extra attention to loop-closure sites, because switching a captured loop variable to let changes it from one shared binding to a fresh binding per iteration, which is almost always what was intended.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo