Unused error variables in catch block are not allowed (#24487)

This commit is contained in:
Alisa
2026-04-01 21:33:07 -07:00
committed by GitHub
parent 0711eaf26e
commit 72a6cbed5f
92 changed files with 162 additions and 157 deletions
+1 -1
View File
@@ -195,7 +195,7 @@ function doesVersionExist({ args, version } = {}) {
console.error(`Version ${version} already exists on NPM.`);
return true;
}
} catch (_error) {
} catch {
// This is expected if the version doesn't exist.
}
+3 -3
View File
@@ -177,7 +177,7 @@ function runCommand(command, stdio = 'inherit') {
].join(sep);
execSync(command, { stdio, env, shell: true });
return true;
} catch (_e) {
} catch {
return false;
}
}
@@ -267,7 +267,7 @@ export function runSensitiveKeywordLinter() {
.trim()
.split('\n')
.filter(Boolean);
} catch (_error) {
} catch {
console.error(`Could not get changed files against origin/${baseRef}.`);
try {
console.log('Falling back to diff against HEAD~1');
@@ -276,7 +276,7 @@ export function runSensitiveKeywordLinter() {
.trim()
.split('\n')
.filter(Boolean);
} catch (_fallbackError) {
} catch {
console.error('Could not get changed files against HEAD~1 either.');
process.exit(1);
}
+4 -4
View File
@@ -105,11 +105,11 @@ async function main() {
try {
execSync('pkill -f "otelcol-contrib"');
console.log('✅ Stopped existing otelcol-contrib process.');
} catch (_e) {} // eslint-disable-line no-empty
} catch {} // eslint-disable-line no-empty
try {
execSync('pkill -f "jaeger"');
console.log('✅ Stopped existing jaeger process.');
} catch (_e) {} // eslint-disable-line no-empty
} catch {} // eslint-disable-line no-empty
try {
if (fileExists(OTEL_LOG_FILE)) fs.unlinkSync(OTEL_LOG_FILE);
console.log('✅ Deleted old collector log.');
@@ -155,7 +155,7 @@ async function main() {
try {
await waitForPort(JAEGER_PORT);
console.log(`✅ Jaeger started successfully.`);
} catch (_) {
} catch {
console.error(`🛑 Error: Jaeger failed to start on port ${JAEGER_PORT}.`);
if (jaegerProcess && jaegerProcess.pid) {
process.kill(jaegerProcess.pid, 'SIGKILL');
@@ -180,7 +180,7 @@ async function main() {
try {
await waitForPort(4317);
console.log(`✅ OTEL collector started successfully.`);
} catch (_) {
} catch {
console.error(`🛑 Error: OTEL collector failed to start on port 4317.`);
if (collectorProcess && collectorProcess.pid) {
process.kill(collectorProcess.pid, 'SIGKILL');
+2 -2
View File
@@ -180,7 +180,7 @@ async function main() {
// Re-throw if it's not a conflict error
throw error;
}
} catch (_statusError) {
} catch {
// Re-throw original error if we can't determine the status
throw error;
}
@@ -268,7 +268,7 @@ function branchExists(branchName) {
try {
execSync(`git ls-remote --exit-code --heads origin ${branchName}`);
return true;
} catch (_e) {
} catch {
return false;
}
}
+1 -1
View File
@@ -374,7 +374,7 @@ No output was generated during patch creation.
// Clean up temp file
try {
unlinkSync(tmpFile);
} catch (_e) {
} catch {
// Ignore cleanup errors
}
}
+1 -1
View File
@@ -32,7 +32,7 @@ function runCommand(command) {
stdio: ['ignore', 'pipe', 'ignore'],
maxBuffer: 10 * 1024 * 1024,
});
} catch (_e) {
} catch {
return null;
}
}
+1 -1
View File
@@ -118,7 +118,7 @@ async function main() {
try {
execSync('pkill -f "otelcol-contrib"');
console.log('✅ Stopped existing otelcol-contrib process.');
} catch (_e) {
} catch {
/* no-op */
}
try {
+1 -1
View File
@@ -438,7 +438,7 @@ export function registerCleanup(
if (fd) {
try {
fs.closeSync(fd);
} catch (_) {
} catch {
/* no-op */
}
}