diff --git a/packages/plugin-runtime/src/PluginInstance.ts b/packages/plugin-runtime/src/PluginInstance.ts index dcbc8753..451d648f 100644 --- a/packages/plugin-runtime/src/PluginInstance.ts +++ b/packages/plugin-runtime/src/PluginInstance.ts @@ -328,7 +328,7 @@ export class PluginInstance { payload.values = applyFormInputDefaults(args, payload.values); const resolvedArgs = await applyDynamicFormInput(ctx, args, payload); const resolvedActions: HttpAuthenticationAction[] = []; - for (const { onSelect, ...action } of actions ?? []) { + for (const { onSelect: _onSelect, ...action } of actions ?? []) { resolvedActions.push(action); } @@ -973,7 +973,7 @@ export class PluginInstance { function stripDynamicCallbacks(inputs: { dynamic?: unknown }[]): FormInput[] { return inputs.map((input) => { // biome-ignore lint/suspicious/noExplicitAny: stripping dynamic from union type - const { dynamic, ...rest } = input as any; + const { dynamic: _dynamic, ...rest } = input as any; if ('inputs' in rest && Array.isArray(rest.inputs)) { rest.inputs = stripDynamicCallbacks(rest.inputs); } diff --git a/packages/plugin-runtime/src/interceptStdout.ts b/packages/plugin-runtime/src/interceptStdout.ts index 089d0a31..940c1246 100644 --- a/packages/plugin-runtime/src/interceptStdout.ts +++ b/packages/plugin-runtime/src/interceptStdout.ts @@ -24,5 +24,5 @@ export function interceptStdout(intercept: (text: string) => string) { } function interceptor(text: string, fn: (text: string) => string) { - return fn(text).replace(/\n$/, '') + (fn(text) && /\n$/.test(text) ? '\n' : ''); + return fn(text).replace(/\n$/, '') + (fn(text) && text.endsWith('\n') ? '\n' : ''); } diff --git a/plugins/auth-oauth2/src/grants/authorizationCode.ts b/plugins/auth-oauth2/src/grants/authorizationCode.ts index fc2b535f..3138141f 100644 --- a/plugins/auth-oauth2/src/grants/authorizationCode.ts +++ b/plugins/auth-oauth2/src/grants/authorizationCode.ts @@ -148,7 +148,7 @@ async function getCodeViaEmbeddedBrowser( const authorizationUrlStr = authorizationUrl.toString(); console.log('[oauth2] Authorizing via embedded browser', authorizationUrlStr); - // biome-ignore lint/suspicious/noAsyncPromiseExecutor: Required for this pattern + // oxlint-disable-next-line no-async-promise-executor -- Required for this pattern return new Promise(async (resolve, reject) => { let foundCode = false; const { close } = await ctx.window.openUrl({ diff --git a/plugins/auth-oauth2/src/grants/implicit.ts b/plugins/auth-oauth2/src/grants/implicit.ts index 3ec58502..5b24e562 100644 --- a/plugins/auth-oauth2/src/grants/implicit.ts +++ b/plugins/auth-oauth2/src/grants/implicit.ts @@ -105,7 +105,7 @@ async function getTokenViaEmbeddedBrowser( const authorizationUrlStr = authorizationUrl.toString(); console.log('[oauth2] Authorizing via embedded browser (implicit)', authorizationUrlStr); - // biome-ignore lint/suspicious/noAsyncPromiseExecutor: Required for this pattern + // oxlint-disable-next-line no-async-promise-executor -- Required for this pattern return new Promise(async (resolve, reject) => { let foundAccessToken = false; const { close } = await ctx.window.openUrl({ diff --git a/scripts/install-wasm-pack.cjs b/scripts/install-wasm-pack.cjs index 0cad3e52..ab637941 100644 --- a/scripts/install-wasm-pack.cjs +++ b/scripts/install-wasm-pack.cjs @@ -12,7 +12,7 @@ execSync('cargo install wasm-pack --locked', { stdio: 'inherit' }); function tryExecSync(cmd) { try { return execSync(cmd, { stdio: 'pipe' }).toString('utf-8'); - } catch (_) { + } catch { return ''; } } diff --git a/scripts/run-workspaces-dev.mjs b/scripts/run-workspaces-dev.mjs index 563d93cf..72070fbc 100644 --- a/scripts/run-workspaces-dev.mjs +++ b/scripts/run-workspaces-dev.mjs @@ -52,7 +52,7 @@ for (const ws of workspacesWithDev) { // Cleanup function to kill all children function cleanup() { - for (const { ws, child } of children) { + for (const { child } of children) { if (child.exitCode === null) { // Process still running if (process.platform === 'win32') { diff --git a/scripts/vendor-node.cjs b/scripts/vendor-node.cjs index 92160b3a..1d7b180b 100644 --- a/scripts/vendor-node.cjs +++ b/scripts/vendor-node.cjs @@ -105,7 +105,7 @@ rmSync(tmpDir, { recursive: true, force: true }); function tryExecSync(cmd) { try { return execSync(cmd, { stdio: 'pipe' }).toString('utf-8'); - } catch (_) { + } catch { return ''; } } diff --git a/scripts/vendor-protoc.cjs b/scripts/vendor-protoc.cjs index 439bb10c..0d0deb49 100644 --- a/scripts/vendor-protoc.cjs +++ b/scripts/vendor-protoc.cjs @@ -106,7 +106,7 @@ mkdirSync(dstDir, { recursive: true }); function tryExecSync(cmd) { try { return execSync(cmd, { stdio: 'pipe' }).toString('utf-8'); - } catch (_) { + } catch { return ''; } } diff --git a/src-web/components/DynamicForm.tsx b/src-web/components/DynamicForm.tsx index 00e79300..72d5fc34 100644 --- a/src-web/components/DynamicForm.tsx +++ b/src-web/components/DynamicForm.tsx @@ -512,16 +512,14 @@ function HttpRequestArg({ help={arg.description} value={value} disabled={arg.disabled} - options={[ - ...httpRequests.map((r) => { + options={httpRequests.map((r) => { return { label: buildRequestBreadcrumbs(r, folders).join(' / ') + (r.id === activeHttpRequest?.id ? ' (current)' : ''), value: r.id, }; - }), - ]} + })} /> ); } diff --git a/src-web/components/core/AutoScroller.tsx b/src-web/components/core/AutoScroller.tsx index 574d32ff..1376b885 100644 --- a/src-web/components/core/AutoScroller.tsx +++ b/src-web/components/core/AutoScroller.tsx @@ -54,7 +54,7 @@ export function AutoScroller({ useLayoutEffect(() => { if (!autoScroll) return; - data.length; // Make linter happy. We want to refresh when length changes + void data.length; // Trigger refresh when length changes const el = containerRef.current; if (el == null) return; diff --git a/src-web/components/core/SegmentedControl.tsx b/src-web/components/core/SegmentedControl.tsx index b75060f3..e7547f4b 100644 --- a/src-web/components/core/SegmentedControl.tsx +++ b/src-web/components/core/SegmentedControl.tsx @@ -62,13 +62,13 @@ export function SegmentedControl({ if (e.key === 'ArrowRight') { e.preventDefault(); const newIndex = Math.abs((selectedIndex + 1) % options.length); - options[newIndex] && setSelectedValue(options[newIndex].value); + if (options[newIndex]) setSelectedValue(options[newIndex].value); const child = containerRef.current?.children[newIndex] as HTMLButtonElement; child.focus(); } else if (e.key === 'ArrowLeft') { e.preventDefault(); const newIndex = Math.abs((selectedIndex - 1) % options.length); - options[newIndex] && setSelectedValue(options[newIndex].value); + if (options[newIndex]) setSelectedValue(options[newIndex].value); const child = containerRef.current?.children[newIndex] as HTMLButtonElement; child.focus(); } diff --git a/src-web/components/responseViewers/PdfViewer.tsx b/src-web/components/responseViewers/PdfViewer.tsx index d2fd239f..009cd637 100644 --- a/src-web/components/responseViewers/PdfViewer.tsx +++ b/src-web/components/responseViewers/PdfViewer.tsx @@ -56,7 +56,7 @@ export function PdfViewer({ bodyPath, data }: Props) { externalLinkTarget="_blank" externalLinkRel="noopener noreferrer" > - {Array.from(new Array(numPages), (_, index) => ( + {Array.from({ length: numPages }, (_, index) => (