Skip to content

Commit 8b821cd

Browse files
fix: resolve ESLint errors blocking CI
Fix no-useless-escape, no-undef, prefer-const, and preserve-caught-error lint errors in validators, bump-version, apex-analysis, and install-config.
1 parent cb5a338 commit 8b821cd

5 files changed

Lines changed: 6 additions & 8 deletions

File tree

scripts/ci/validate-agents.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function validateAgent(filePath, availableSkills) {
151151
);
152152
}
153153

154-
if (!/do not|don\'t|not for|except|excluding/i.test(desc)) {
154+
if (!/do not|don't|not for|except|excluding/i.test(desc)) {
155155
warn(relPath, 'description missing WHEN NOT clause — add "Do NOT use for [exclusions]"');
156156
}
157157
}
@@ -195,8 +195,6 @@ function validateAgent(filePath, availableSkills) {
195195
const FILE_WRITE_TOOLS = new Set(['write', 'edit', 'multiedit']);
196196
const readonly = parseBool(frontmatter.readonly);
197197
const hasFileWriteTools = toolsList.some(t => FILE_WRITE_TOOLS.has(t));
198-
const hasDestructiveTools = toolsList.some(t => DESTRUCTIVE_TOOLS.has(t));
199-
200198
if (readonly === true && hasFileWriteTools) {
201199
const writeTools = toolsList.filter(t => FILE_WRITE_TOOLS.has(t));
202200
fileErrors.push(
@@ -300,7 +298,7 @@ function validateAgent(filePath, availableSkills) {
300298
if (readonly !== true) {
301299
warn(relPath, 'inspector agent should have readonly: true');
302300
}
303-
if (hasWriteTools) {
301+
if (hasFileWriteTools) {
304302
fileErrors.push('inspector agent must not have write tools — inspectors are read-only');
305303
}
306304
}

scripts/ci/validate-skills.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ function validateSkill(skillDir, file) {
216216
);
217217
}
218218

219-
if (!/do not|don\'t|not for|except|excluding/i.test(desc)) {
219+
if (!/do not|don't|not for|except|excluding/i.test(desc)) {
220220
warn(label, 'description missing WHEN NOT clause — add "Do NOT use for [exclusions]"');
221221
}
222222
}

scripts/dev/bump-version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function updateFile(filePath, oldVersion, newVersion) {
5252
const fullPath = path.join(ROOT, filePath);
5353
if (!fs.existsSync(fullPath)) return false;
5454

55-
let content = fs.readFileSync(fullPath, 'utf8');
55+
const content = fs.readFileSync(fullPath, 'utf8');
5656
const updated = content.replace(
5757
new RegExp(`"version":\\s*"${oldVersion.replace(/\./g, '\\.')}"`, 'g'),
5858
`"version": "${newVersion}"`

scripts/lib/apex-analysis.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function isTestClass(code) {
7474
function trackLoopDepth(processedLines) {
7575
const depths = [];
7676
let globalBraceDepth = 0; // total brace depth in file
77-
let activeLoopDepths = []; // stack: globalBraceDepth where each braced loop started
77+
const activeLoopDepths = []; // stack: globalBraceDepth where each braced loop started
7878
let unbracedStack = 0; // counter for nested unbraced loops
7979
let parenDepth = 0; // for multi-line for/while declarations
8080
let pendingLoop = false; // SCANNING_DECLARATION state

scripts/lib/install-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function loadInstallConfig(configPath) {
5151
try {
5252
raw = JSON.parse(fs.readFileSync(resolved, 'utf8'));
5353
} catch (err) {
54-
throw new Error(`Invalid JSON in config ${resolved}: ${err.message}`);
54+
throw new Error(`Invalid JSON in config ${resolved}: ${err.message}`, { cause: err });
5555
}
5656

5757
// Validate against schema

0 commit comments

Comments
 (0)