From b6da5e8c36b5211abe179b826b7fe5856c0cd4f2 Mon Sep 17 00:00:00 2001 From: Lukas Kosina Date: Sun, 22 Feb 2026 12:36:25 +0100 Subject: [PATCH 1/4] Fix errors --- eslint.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint.config.js b/eslint.config.js index d23f66e..be31149 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -116,6 +116,7 @@ export default [ ErrorEvent: 'readonly', CanvasRenderingContext2D: 'readonly', BlobCallback: 'readonly', + TimerHandler: 'readonly', }, }, rules: { From 3d4429e26815b0cddfc92ff4d25d06055b31c078 Mon Sep 17 00:00:00 2001 From: Lukas Kosina Date: Sun, 22 Feb 2026 12:45:15 +0100 Subject: [PATCH 2/4] Fix the issue with typing --- src/test/setup.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/setup.ts b/src/test/setup.ts index e559cb8..761894e 100644 --- a/src/test/setup.ts +++ b/src/test/setup.ts @@ -11,7 +11,11 @@ beforeAll(() => { // which returns empty strings in jsdom. parseFloat('') → NaN → setTimeout(fn, NaN) // triggers Node.js TimeoutNaNWarning. const origSetTimeout = globalThis.setTimeout; - globalThis.setTimeout = ((handler: TimerHandler, timeout?: number, ...args: unknown[]) => { + globalThis.setTimeout = (( + handler: (...args: unknown[]) => void | string, + timeout?: number, + ...args: unknown[] + ) => { return origSetTimeout( handler, typeof timeout === 'number' && Number.isNaN(timeout) ? 0 : timeout, From 66f477e19b5b12f210cc60e6ed1fdb3423995cbd Mon Sep 17 00:00:00 2001 From: Lukas Kosina Date: Sun, 22 Feb 2026 12:57:28 +0100 Subject: [PATCH 3/4] Disable ESLint no-undef for TypeScript files TypeScript handles undefined variable checking better than ESLint's no-undef rule. This fixes CI failures where no-undef doesn't understand TypeScript types like TimerHandler. Reverts the inline type workaround and removes type-only globals that were only needed to suppress no-undef. Co-Authored-By: Claude Opus 4.6 --- eslint.config.js | 6 +----- src/test/setup.ts | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index be31149..328041f 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -91,6 +91,7 @@ export default [ 'prefer-const': 'error', 'no-var': 'error', 'no-control-regex': 'off', + 'no-undef': 'off', // TypeScript handles this better than ESLint }, settings: { react: { @@ -112,11 +113,6 @@ export default [ test: 'readonly', Event: 'readonly', global: 'readonly', - GlobalEventHandlers: 'readonly', - ErrorEvent: 'readonly', - CanvasRenderingContext2D: 'readonly', - BlobCallback: 'readonly', - TimerHandler: 'readonly', }, }, rules: { diff --git a/src/test/setup.ts b/src/test/setup.ts index 761894e..e559cb8 100644 --- a/src/test/setup.ts +++ b/src/test/setup.ts @@ -11,11 +11,7 @@ beforeAll(() => { // which returns empty strings in jsdom. parseFloat('') → NaN → setTimeout(fn, NaN) // triggers Node.js TimeoutNaNWarning. const origSetTimeout = globalThis.setTimeout; - globalThis.setTimeout = (( - handler: (...args: unknown[]) => void | string, - timeout?: number, - ...args: unknown[] - ) => { + globalThis.setTimeout = ((handler: TimerHandler, timeout?: number, ...args: unknown[]) => { return origSetTimeout( handler, typeof timeout === 'number' && Number.isNaN(timeout) ? 0 : timeout, From 49d802f3c4de76a9376cac1c8c79f00cd268a9ba Mon Sep 17 00:00:00 2001 From: Lukas Kosina Date: Sun, 22 Feb 2026 13:16:46 +0100 Subject: [PATCH 4/4] Fix CI to test PR code by using pull_request trigger Replace pull_request_target with pull_request so actions/checkout checks out the PR branch instead of the base branch. This ensures the ESLint no-undef fix is actually tested in CI. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 842afd4..3f64401 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ on: branches: - master - develop - pull_request_target: + pull_request: branches: - '*' - '**'