fix: prefix unused watcherReady with underscore

This commit is contained in:
kumarabhirup 2026-02-20 00:42:22 -08:00
parent d2015fd9d5
commit b4502d7bc6
No known key found for this signature in database
GPG Key ID: DB7CA2289CAB0167

View File

@ -15,7 +15,7 @@ let listeners = new Set<Listener>();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let sharedWatcher: any = null;
let sharedRoot: string | null = null;
let watcherReady = false;
let __watcherReady = false;
async function ensureWatcher(root: string) {
if (sharedWatcher && sharedRoot === root) {return;}
@ -25,7 +25,7 @@ async function ensureWatcher(root: string) {
await sharedWatcher.close();
sharedWatcher = null;
sharedRoot = null;
watcherReady = false;
_watcherReady = false;
}
try {
@ -54,7 +54,7 @@ async function ensureWatcher(root: string) {
for (const fn of listeners) {fn(eventType, rel);}
});
sharedWatcher.once("ready", () => {watcherReady = true;});
sharedWatcher.once("ready", () => {_watcherReady = true;});
sharedWatcher.on("error", () => {
// Swallow; polling mode shouldn't hit EMFILE but be safe.
@ -69,7 +69,7 @@ function stopWatcherIfIdle() {
sharedWatcher.close();
sharedWatcher = null;
sharedRoot = null;
watcherReady = false;
_watcherReady = false;
}
/**