Skip to content

Commit 361e03a

Browse files
committed
fix(scripts): hoist logger to module scope in check.mjs
Fixes ReferenceError where logger was undefined in main().catch() handler. Logger was previously scoped only within runEslintCheck function but used throughout the file.
1 parent d9d6f85 commit 361e03a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/cli/scripts/check.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { getDefaultLogger } from '@socketsecurity/lib/logger'
99
import { spawn } from '@socketsecurity/lib/spawn'
1010
import { printFooter, printHeader } from '@socketsecurity/lib/stdio/header'
1111

12+
const logger = getDefaultLogger()
13+
1214
/**
1315
* Run ESLint check via lint script.
1416
*/
@@ -21,7 +23,6 @@ async function runEslintCheck(options = {}) {
2123
} = options
2224

2325
if (!quiet) {
24-
const logger = getDefaultLogger()
2526
logger.progress('Checking ESLint')
2627
}
2728

0 commit comments

Comments
 (0)