Fix oxlint warnings, extract dialog polyfill, deny warnings in gate
Adds void to floating promise in bestiary-cache.ts, extracts shared polyfillDialog() helper to eliminate unbound-method warnings in 3 test files. Adds --deny warnings to oxlint so future warnings fail the build. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
16
apps/web/src/__tests__/polyfill-dialog.ts
Normal file
16
apps/web/src/__tests__/polyfill-dialog.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* jsdom doesn't implement HTMLDialogElement.showModal/close.
|
||||
* Call this in beforeAll() for tests that render <Dialog>.
|
||||
*/
|
||||
export function polyfillDialog(): void {
|
||||
if (typeof HTMLDialogElement.prototype.showModal !== "function") {
|
||||
HTMLDialogElement.prototype.showModal = function showModal() {
|
||||
this.setAttribute("open", "");
|
||||
};
|
||||
}
|
||||
if (typeof HTMLDialogElement.prototype.close !== "function") {
|
||||
HTMLDialogElement.prototype.close = function close() {
|
||||
this.removeAttribute("open");
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user