fix(ui): enable more rules

This commit is contained in:
Julian Sommer
2026-05-08 11:55:18 +10:00
parent f8ce8de566
commit 1c3583651d
3 changed files with 15 additions and 3 deletions
@@ -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": [
@@ -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
},
@@ -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)