diff --git a/spinifex/services/spinifexui/frontend/oxlint.config.ts b/spinifex/services/spinifexui/frontend/oxlint.config.ts index 831784b7f..d64e831a3 100644 --- a/spinifex/services/spinifexui/frontend/oxlint.config.ts +++ b/spinifex/services/spinifexui/frontend/oxlint.config.ts @@ -36,13 +36,22 @@ export default defineConfig({ "eslint/prefer-destructuring": "off", "eslint/require-unicode-regexp": "off", "eslint/sort-keys": "off", - "eslint/sort-vars": "off", "import/consistent-type-specifier-style": "off", - "promise/prefer-await-to-callbacks": "off", "typescript/no-confusing-void-expression": "off", "typescript/no-floating-promises": "off", "typescript/no-misused-promises": "off", - "typescript/only-throw-error": "off", + "typescript/only-throw-error": [ + "error", + { + allow: [ + { + from: "package", + name: "Redirect", + package: "@tanstack/router-core", + }, + ], + }, + ], "typescript/strict-boolean-expressions": "off", "typescript/strict-void-return": "off", "unicorn/filename-case": [ diff --git a/spinifex/services/spinifexui/frontend/src/hooks/use-mobile.test.tsx b/spinifex/services/spinifexui/frontend/src/hooks/use-mobile.test.tsx index b9e31a6c5..3d14e18e0 100644 --- a/spinifex/services/spinifexui/frontend/src/hooks/use-mobile.test.tsx +++ b/spinifex/services/spinifexui/frontend/src/hooks/use-mobile.test.tsx @@ -8,6 +8,7 @@ function mockMatchMedia(matches: boolean) { writable: true, value: vi.fn().mockReturnValue({ matches, + // oxlint-disable-next-line promise/prefer-await-to-callbacks -- mocking matchMedia DOM API addEventListener: (_event: string, cb: () => void) => { changeListener = cb }, @@ -45,6 +46,7 @@ describe("useIsMobile", () => { it("updates when viewport changes", async () => { const mqlMock = { matches: false, + // oxlint-disable-next-line promise/prefer-await-to-callbacks -- mocking matchMedia DOM API addEventListener: (_event: string, cb: () => void) => { changeListener = cb }, diff --git a/spinifex/services/spinifexui/frontend/src/hooks/use-mobile.tsx b/spinifex/services/spinifexui/frontend/src/hooks/use-mobile.tsx index ee3aaefe0..587bfc6cc 100644 --- a/spinifex/services/spinifexui/frontend/src/hooks/use-mobile.tsx +++ b/spinifex/services/spinifexui/frontend/src/hooks/use-mobile.tsx @@ -4,6 +4,7 @@ const MOBILE_BREAKPOINT = 768 const MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)` const mql = window.matchMedia(MEDIA_QUERY) +// oxlint-disable-next-line promise/prefer-await-to-callbacks -- useSyncExternalStore subscriber API requires a callback function subscribe(callback: () => void): () => void { mql.addEventListener("change", callback) return () => mql.removeEventListener("change", callback)