Compare commits

...

4 Commits

Author SHA1 Message Date
31cc0660bc refactor(ebay): reuse fetchHtml after challenge
Signed-off-by: Dmytro Stanchiev <git@dmytros.dev>
2026-04-30 22:26:24 -04:00
fc7200777e style: format expected json output in protocol test 2026-04-30 22:25:47 -04:00
f68a5a8d9b feat(linter): enforce correctness on unused imports
Configures the linter to treat unused imports as an error under the
`correctness` rule category. This tightens up code quality standards by
ensuring all imported bindings are utilized.
If the import is unused, there is a high chance refactoring missed this
flow. Review in-depth root causes.
2026-04-30 22:24:06 -04:00
a6b24b318e fix(types): expose argon2 declaration globally 2026-04-30 22:16:48 -04:00
7 changed files with 11 additions and 15 deletions

View File

@@ -15,7 +15,10 @@
"linter": { "linter": {
"enabled": true, "enabled": true,
"rules": { "rules": {
"recommended": true "recommended": true,
"correctness": {
"noUnusedImports": "error"
}
} }
}, },
"javascript": { "javascript": {

View File

@@ -5,5 +5,5 @@
"@/*": ["./src/*"] "@/*": ["./src/*"]
} }
}, },
"include": ["./src", "./test"] "include": ["./src", "./test", "../../types/**/*.d.ts"]
} }

View File

@@ -876,19 +876,10 @@ export default async function fetchEbayItems(
// Delay briefly before retry // Delay briefly before retry
await delay(DELAY_MS); await delay(DELAY_MS);
res = await fetch(searchUrl, { const retryHtml = await fetchHtml(searchUrl, DELAY_MS, {
method: "GET",
headers: searchHeaders, headers: searchHeaders,
}); });
if (!res.ok && res.status !== 200) {
logger.warn(`Retry after challenge returned ${res.status}`);
return finalizeResults([]);
}
const retryHtml = await res.text();
await delay(DELAY_MS);
const listings = parseEbayListings( const listings = parseEbayListings(
retryHtml, retryHtml,
keywords, keywords,

View File

@@ -5,5 +5,5 @@
"@/*": ["./src/*"] "@/*": ["./src/*"]
} }
}, },
"include": ["./src", "./test"] "include": ["./src", "./test", "../../types/**/*.d.ts"]
} }

View File

@@ -176,7 +176,9 @@ describe("MCP protocol unstableFilter", () => {
const body = await response.json(); const body = await response.json();
expect(body.result.content[0].type).toBe("text"); expect(body.result.content[0].type).toBe("text");
expect(JSON.parse(body.result.content[0].text)).toEqual([{ title: "item" }]); expect(JSON.parse(body.result.content[0].text)).toEqual([
{ title: "item" },
]);
}); });
test("handler should forward unstableFilter=true for search_ebay", async () => { test("handler should forward unstableFilter=true for search_ebay", async () => {

View File

@@ -5,5 +5,5 @@
"@/*": ["./src/*"] "@/*": ["./src/*"]
} }
}, },
"include": ["./src", "./test"] "include": ["./src", "./test", "../../types/**/*.d.ts"]
} }