Skip to content

Commit 92bd0bc

Browse files
committed
🔧 Fix error handling for better ESLint compatibility
Rename caught error variables to follow ESLint naming convention Update error handling across plugins to use _err pattern for unused caught errors, avoiding ESLint warnings. Add corresponding rule to eslint.config.mjs with caughtErrorsIgnorePattern to standardize this approach project-wide. This change maintains all error handling functionality while making the codebase more consistent with our linting standards.
1 parent 16636f6 commit 92bd0bc

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

eslint.config.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const eslintConfig = [
4545
{
4646
argsIgnorePattern: "^_",
4747
varsIgnorePattern: "^h$",
48+
caughtErrorsIgnorePattern: "^_"
4849
},
4950
],
5051
},

plugins/decorators.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const EFFECT_METADATA_SYMBOL = Symbol.for('lightscript:effect');
6060
// Quietly reload without noisy output
6161
server.ws.send({ type: "full-reload" });
6262
}
63-
} catch (err) {
63+
} catch (_err) {
6464
console.error(`[✗] Error processing file ${path}`);
6565
}
6666
}

plugins/signalrgb.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function extractAllDecorators(
103103
property: propertyName,
104104
options: options,
105105
});
106-
} catch (err) {
106+
} catch (_err) {
107107
logger.error(`Error parsing ${decoratorName} decorator`);
108108
}
109109
}
@@ -301,7 +301,7 @@ function processEffect(effect: (typeof effects)[0]) {
301301
}
302302
}
303303
}
304-
} catch (err) {
304+
} catch (_err) {
305305
logger.error(`Error extracting metadata for ${effect.id}`);
306306
}
307307

@@ -334,7 +334,7 @@ function processEffect(effect: (typeof effects)[0]) {
334334
);
335335

336336
logger.effect(effect.id, "HTML file created successfully");
337-
} catch (err) {
337+
} catch (_err) {
338338
logger.error(`Error processing effect ${effect.id}`);
339339
}
340340
}

0 commit comments

Comments
 (0)