diff --git a/packages/vscode-ide-companion/eslint.config.mjs b/packages/vscode-ide-companion/eslint.config.mjs index 4b444a9b2..80945e52c 100644 --- a/packages/vscode-ide-companion/eslint.config.mjs +++ b/packages/vscode-ide-companion/eslint.config.mjs @@ -67,7 +67,7 @@ export default [ ], curly: 'warn', - eqeqeq: 'warn', + eqeqeq: ['warn', 'always', { null: 'ignore' }], 'no-throw-literal': 'warn', semi: 'warn', }, diff --git a/packages/vscode-ide-companion/src/extension.ts b/packages/vscode-ide-companion/src/extension.ts index 2bfb1a1f2..4629ae932 100644 --- a/packages/vscode-ide-companion/src/extension.ts +++ b/packages/vscode-ide-companion/src/extension.ts @@ -218,7 +218,9 @@ export async function activate(context: vscode.ExtensionContext) { const sendCopyToActive = (action: string) => { for (const provider of chatProviderRegistry?.getPermissionAwareProviders() ?? []) { - if (provider.sendCopyCommand(action)) break; + if (provider.sendCopyCommand(action)) { + break; + } } }; context.subscriptions.push( diff --git a/packages/vscode-ide-companion/src/webview/App.tsx b/packages/vscode-ide-companion/src/webview/App.tsx index 7800b33fd..167800cd2 100644 --- a/packages/vscode-ide-companion/src/webview/App.tsx +++ b/packages/vscode-ide-companion/src/webview/App.tsx @@ -177,7 +177,9 @@ const MessageList = React.memo( } // No wrapper div — message components render directly as children // of the scroll container, preserving the original CSS layout. - if (child == null) return null; + if (child == null) { + return null; + } mapping.push(index); return {child}; }); @@ -213,7 +215,9 @@ function findMessageIndex( while (directChild && directChild.parentElement !== container) { directChild = directChild.parentElement; } - if (!directChild) return -1; + if (!directChild) { + return -1; + } // Find DOM child position among container's children const children = container.children; @@ -1211,7 +1215,9 @@ export const App: React.FC = () => { useEffect(() => { const handler = (event: MessageEvent) => { const message = event.data; - if (message?.type !== 'copyCommand') return; + if (message?.type !== 'copyCommand') { + return; + } const { action } = message.data as { action: string }; @@ -1242,7 +1248,9 @@ export const App: React.FC = () => { msg.kind === 'image' && msg.imagePath ? `![image](${msg.imagePath})` : (msg.content || '').trim(); - if (!content) continue; + if (!content) { + continue; + } if (msg.role === 'user') { parts.push(`**User:** ${content}`); } else if (msg.role === 'thinking') { @@ -1255,7 +1263,9 @@ export const App: React.FC = () => { item.type === 'in-progress-tool-call' ) { const tc = item.data as ToolCallData; - if (!shouldShowToolCall(tc.kind)) continue; + if (!shouldShowToolCall(tc.kind)) { + continue; + } const text = formatToolCallForCopy(tc, true); if (text) { parts.push(`**[Tool: ${tc.kind}]**\n\n${text}`); diff --git a/packages/vscode-ide-companion/src/webview/providers/WebViewProvider.ts b/packages/vscode-ide-companion/src/webview/providers/WebViewProvider.ts index 222db5844..69ed94c96 100644 --- a/packages/vscode-ide-companion/src/webview/providers/WebViewProvider.ts +++ b/packages/vscode-ide-companion/src/webview/providers/WebViewProvider.ts @@ -1737,9 +1737,13 @@ export class WebViewProvider { * The webview resolves the content and posts back a 'copyToClipboard' message. */ sendCopyCommand(action: string): boolean { - if (WebViewProvider.lastContextMenuProvider !== this) return false; + if (WebViewProvider.lastContextMenuProvider !== this) { + return false; + } const webview = this.getActiveWebview(); - if (!webview) return false; + if (!webview) { + return false; + } webview.postMessage({ type: 'copyCommand', data: { action } }); return true; }