mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-23 04:36:40 +00:00
fix(ui): enable more rules
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user