diff --git a/biome.json b/biome.json index 1ce7e15..a773dc7 100644 --- a/biome.json +++ b/biome.json @@ -1,7 +1,15 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.0/schema.json", + "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json", "files": { - "ignore": [".tsimp", ".yarn", "coverage", "dist", ".pnp.cjs", ".pnp.loader.mjs"] + "includes": [ + "**", + "!**/.tsimp", + "!**/.yarn", + "!**/coverage", + "!**/dist", + "!**/.pnp.cjs", + "!**/.pnp.loader.mjs" + ] }, "formatter": { "lineWidth": 100, @@ -14,10 +22,15 @@ }, "correctness": { "noUnusedImports": "warn", - "noUnusedVariables": "warn" + "noUnusedVariables": { + "level": "warn", + "options": { + "ignoreRestSiblings": true + } + } }, "suspicious": { - "noConsoleLog": "warn" + "noConsole": "warn" } } }, @@ -33,17 +46,11 @@ }, "overrides": [ { - "include": ["**/package.json"], - "formatter": { - "lineWidth": 1 - } - }, - { - "include": ["**/vite.config.ts"], + "includes": ["**/vite.config.ts"], "linter": { "rules": { "suspicious": { - "noConsoleLog": "off" + "noConsole": "off" } } } diff --git a/package.json b/package.json index b7a4f86..966d83f 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ }, "license": "MIT", "devDependencies": { - "@biomejs/biome": "1.9.0", + "@biomejs/biome": "2.0.0", "@testing-library/dom": "^10.0.0", "@testing-library/react": "^16.0.0", "@types/react": "*", diff --git a/src/useDebouncedEffect.spec.ts b/src/useDebouncedEffect.spec.ts index 570e432..e1b06c5 100644 --- a/src/useDebouncedEffect.spec.ts +++ b/src/useDebouncedEffect.spec.ts @@ -7,6 +7,7 @@ import type { DependencyList, EffectCallback } from 'react'; const itIfWindowDefined = it.runIf(typeof window !== 'undefined'); +// biome-ignore lint/correctness/useHookAtTopLevel: False positive, see https://github.com/biomejs/biome/issues/6396 vi.useFakeTimers(); describe('useDebouncedEffect()', () => { diff --git a/src/useDebouncedEffect.ts b/src/useDebouncedEffect.ts index 4002b4b..293f5ae 100644 --- a/src/useDebouncedEffect.ts +++ b/src/useDebouncedEffect.ts @@ -15,7 +15,6 @@ export default function useDebouncedEffect( deps: DependencyList, debounceTime = 250, ): void { - // biome-ignore lint/correctness/useExhaustiveDependencies: Ommitted debounceTime so it is not called every time it changes useEffect(() => { let cleanup: ReturnType; @@ -30,5 +29,6 @@ export default function useDebouncedEffect( cleanup(); } }; + // biome-ignore lint/correctness/useExhaustiveDependencies: Ommitted debounceTime so it is not called every time it changes }, deps); } diff --git a/src/useDebouncedState.spec.ts b/src/useDebouncedState.spec.ts index 72d55ba..dffd7d6 100644 --- a/src/useDebouncedState.spec.ts +++ b/src/useDebouncedState.spec.ts @@ -5,6 +5,7 @@ import useDebouncedState from './useDebouncedState.js'; const itIfWindowDefined = it.runIf(typeof window !== 'undefined'); +// biome-ignore lint/correctness/useHookAtTopLevel: False positive, see https://github.com/biomejs/biome/issues/6396 vi.useFakeTimers(); describe('useDebouncedState()', () => { diff --git a/src/useDebouncedValue.spec.ts b/src/useDebouncedValue.spec.ts index a58eb44..f05e4d1 100644 --- a/src/useDebouncedValue.spec.ts +++ b/src/useDebouncedValue.spec.ts @@ -5,6 +5,7 @@ import useDebouncedValue from './useDebouncedValue.js'; const itIfWindowDefined = it.runIf(typeof window !== 'undefined'); +// biome-ignore lint/correctness/useHookAtTopLevel: False positive, see https://github.com/biomejs/biome/issues/6396 vi.useFakeTimers(); describe('useDebouncedValue()', () => { diff --git a/src/useSetInterval.spec.ts b/src/useSetInterval.spec.ts index cca56a4..64b76c6 100644 --- a/src/useSetInterval.spec.ts +++ b/src/useSetInterval.spec.ts @@ -6,6 +6,7 @@ import useSetInterval from './useSetInterval.js'; const itIfWindowDefined = it.runIf(typeof window !== 'undefined'); const itIfWindowUndefined = it.runIf(typeof window === 'undefined'); +// biome-ignore lint/correctness/useHookAtTopLevel: False positive, see https://github.com/biomejs/biome/issues/6396 vi.useFakeTimers(); describe('useSetInterval()', () => { diff --git a/src/useSetTimeout.spec.ts b/src/useSetTimeout.spec.ts index 14245a5..e353bf6 100644 --- a/src/useSetTimeout.spec.ts +++ b/src/useSetTimeout.spec.ts @@ -6,6 +6,7 @@ import useSetTimeout from './useSetTimeout.js'; const itIfWindowDefined = it.runIf(typeof window !== 'undefined'); const itIfWindowUndefined = it.runIf(typeof window === 'undefined'); +// biome-ignore lint/correctness/useHookAtTopLevel: False positive, see https://github.com/biomejs/biome/issues/6396 vi.useFakeTimers(); describe('useSetTimeout()', () => { diff --git a/src/useTick.spec.ts b/src/useTick.spec.ts index 8985b1d..ae279a4 100644 --- a/src/useTick.spec.ts +++ b/src/useTick.spec.ts @@ -6,6 +6,7 @@ import useTick from './useTick.js'; const itIfWindowDefined = it.runIf(typeof window !== 'undefined'); const itIfWindowUndefined = it.runIf(typeof window === 'undefined'); +// biome-ignore lint/correctness/useHookAtTopLevel: False positive, see https://github.com/biomejs/biome/issues/6396 vi.useFakeTimers(); describe('useTick()', () => { diff --git a/yarn.lock b/yarn.lock index 09ded20..ab1ffd5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30,18 +30,18 @@ __metadata: languageName: node linkType: hard -"@biomejs/biome@npm:1.9.0": - version: 1.9.0 - resolution: "@biomejs/biome@npm:1.9.0" - dependencies: - "@biomejs/cli-darwin-arm64": "npm:1.9.0" - "@biomejs/cli-darwin-x64": "npm:1.9.0" - "@biomejs/cli-linux-arm64": "npm:1.9.0" - "@biomejs/cli-linux-arm64-musl": "npm:1.9.0" - "@biomejs/cli-linux-x64": "npm:1.9.0" - "@biomejs/cli-linux-x64-musl": "npm:1.9.0" - "@biomejs/cli-win32-arm64": "npm:1.9.0" - "@biomejs/cli-win32-x64": "npm:1.9.0" +"@biomejs/biome@npm:2.0.0": + version: 2.0.0 + resolution: "@biomejs/biome@npm:2.0.0" + dependencies: + "@biomejs/cli-darwin-arm64": "npm:2.0.0" + "@biomejs/cli-darwin-x64": "npm:2.0.0" + "@biomejs/cli-linux-arm64": "npm:2.0.0" + "@biomejs/cli-linux-arm64-musl": "npm:2.0.0" + "@biomejs/cli-linux-x64": "npm:2.0.0" + "@biomejs/cli-linux-x64-musl": "npm:2.0.0" + "@biomejs/cli-win32-arm64": "npm:2.0.0" + "@biomejs/cli-win32-x64": "npm:2.0.0" dependenciesMeta: "@biomejs/cli-darwin-arm64": optional: true @@ -61,62 +61,62 @@ __metadata: optional: true bin: biome: bin/biome - checksum: 10c0/b07ad2c8dc3d52c0a4eea37f98d36399b33a13759903aa65f9678db916810b773fe94937c304899158479bccd8c3c90f0f30af22b34d6dc5963774f1acc5e245 + checksum: 10c0/a255d2e84e303c6b1bd841877463f358415a35fb39dc4051dec80d9dd44e4f2f546e7e13804f7cd9f0932ca11664600f819e0b0dd75c55c2c0571ed771d86cb5 languageName: node linkType: hard -"@biomejs/cli-darwin-arm64@npm:1.9.0": - version: 1.9.0 - resolution: "@biomejs/cli-darwin-arm64@npm:1.9.0" +"@biomejs/cli-darwin-arm64@npm:2.0.0": + version: 2.0.0 + resolution: "@biomejs/cli-darwin-arm64@npm:2.0.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@biomejs/cli-darwin-x64@npm:1.9.0": - version: 1.9.0 - resolution: "@biomejs/cli-darwin-x64@npm:1.9.0" +"@biomejs/cli-darwin-x64@npm:2.0.0": + version: 2.0.0 + resolution: "@biomejs/cli-darwin-x64@npm:2.0.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@biomejs/cli-linux-arm64-musl@npm:1.9.0": - version: 1.9.0 - resolution: "@biomejs/cli-linux-arm64-musl@npm:1.9.0" +"@biomejs/cli-linux-arm64-musl@npm:2.0.0": + version: 2.0.0 + resolution: "@biomejs/cli-linux-arm64-musl@npm:2.0.0" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@biomejs/cli-linux-arm64@npm:1.9.0": - version: 1.9.0 - resolution: "@biomejs/cli-linux-arm64@npm:1.9.0" +"@biomejs/cli-linux-arm64@npm:2.0.0": + version: 2.0.0 + resolution: "@biomejs/cli-linux-arm64@npm:2.0.0" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@biomejs/cli-linux-x64-musl@npm:1.9.0": - version: 1.9.0 - resolution: "@biomejs/cli-linux-x64-musl@npm:1.9.0" +"@biomejs/cli-linux-x64-musl@npm:2.0.0": + version: 2.0.0 + resolution: "@biomejs/cli-linux-x64-musl@npm:2.0.0" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@biomejs/cli-linux-x64@npm:1.9.0": - version: 1.9.0 - resolution: "@biomejs/cli-linux-x64@npm:1.9.0" +"@biomejs/cli-linux-x64@npm:2.0.0": + version: 2.0.0 + resolution: "@biomejs/cli-linux-x64@npm:2.0.0" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@biomejs/cli-win32-arm64@npm:1.9.0": - version: 1.9.0 - resolution: "@biomejs/cli-win32-arm64@npm:1.9.0" +"@biomejs/cli-win32-arm64@npm:2.0.0": + version: 2.0.0 + resolution: "@biomejs/cli-win32-arm64@npm:2.0.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@biomejs/cli-win32-x64@npm:1.9.0": - version: 1.9.0 - resolution: "@biomejs/cli-win32-x64@npm:1.9.0" +"@biomejs/cli-win32-x64@npm:2.0.0": + version: 2.0.0 + resolution: "@biomejs/cli-win32-x64@npm:2.0.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -682,7 +682,7 @@ __metadata: version: 0.0.0-use.local resolution: "@wojtekmaj/react-hooks@workspace:." dependencies: - "@biomejs/biome": "npm:1.9.0" + "@biomejs/biome": "npm:2.0.0" "@testing-library/dom": "npm:^10.0.0" "@testing-library/react": "npm:^16.0.0" "@types/react": "npm:*"