This repo is a min repro for a bug where oxc's no-func-loop rule will error/warn on a catch variable, even though catch variables are block scoped, and are not hoisted outside of the loop.
pnpm install
pnpm lint
Example output
$ oxlint
× eslint(no-loop-func): Function declared in a loop contains unsafe references to variable(s)
╭─[test.js:4:16]
3 │ } catch (e) {
4 │ ╭─▶ setTimeout(() => {
5 │ │ console.log(e);
6 │ ╰─▶ })
7 │ }
╰────
help: Variables declared with 'var' are function-scoped, not block-scoped. Consider using 'let' or 'const' for block-scoped variables, or move the function outside the loop.
Found 0 warnings and 1 error.
Finished in 34ms on 1 file with 96 rules using 8 threads.
[ELIFECYCLE] Command failed with exit code 1.