Fix ESLint errors blocking npm publish

- Remove unused catch binding in _base-ide.js
- Use replaceAll() instead of replace() with regex
- Use String.raw for escape sequences in gemini.js and qwen.js
- Use node: protocol for child_process import

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Mårten Angner 2026-03-01 15:21:21 +01:00
parent 5a297389c8
commit 7c5d946175
4 changed files with 5 additions and 5 deletions

View File

@ -157,7 +157,7 @@ class BaseIdeSetup {
icon: '📋', icon: '📋',
slug: agentName.split('-')[0], slug: agentName.split('-')[0],
}; };
} catch (error) { } catch {
// Fallback metadata on error // Fallback metadata on error
const agentName = path.basename(filePath, '.md'); const agentName = path.basename(filePath, '.md');
return { return {
@ -177,7 +177,7 @@ class BaseIdeSetup {
*/ */
formatAgentLauncher(agentName, agentPath) { formatAgentLauncher(agentName, agentPath) {
const relativePath = path.relative(process.cwd(), agentPath) const relativePath = path.relative(process.cwd(), agentPath)
.replace(/\\/g, '/'); // Convert Windows paths to forward slashes .replaceAll('\\', '/'); // Convert Windows paths to forward slashes
return `<!-- WDS Agent Launcher --> return `<!-- WDS Agent Launcher -->
<!-- This file references the compiled agent. Do not edit directly. --> <!-- This file references the compiled agent. Do not edit directly. -->

View File

@ -33,7 +33,7 @@ class GeminiSetup extends BaseIdeSetup {
metadata.description || 'WDS Agent'; metadata.description || 'WDS Agent';
// Escape content for TOML multi-line string // Escape content for TOML multi-line string
const escapedContent = content.replace(/"""/g, '\\"\\"\\"'); const escapedContent = content.replaceAll('"""', String.raw`\"\"\"`);
return `description = "${description}" return `description = "${description}"

View File

@ -33,7 +33,7 @@ class QwenSetup extends BaseIdeSetup {
metadata.description || 'WDS Agent'; metadata.description || 'WDS Agent';
// Escape content for TOML multi-line string // Escape content for TOML multi-line string
const escapedContent = content.replace(/"""/g, '\\"\\"\\"'); const escapedContent = content.replaceAll('"""', String.raw`\"\"\"`);
return `description = "${description}" return `description = "${description}"

View File

@ -210,7 +210,7 @@ class Installer {
// Get user name from git or system // Get user name from git or system
const getUserName = () => { const getUserName = () => {
try { try {
const { execSync } = require('child_process'); const { execSync } = require('node:child_process');
const gitName = execSync('git config user.name', { encoding: 'utf8' }).trim(); const gitName = execSync('git config user.name', { encoding: 'utf8' }).trim();
return gitName || 'Designer'; return gitName || 'Designer';
} catch { } catch {