diff --git a/biome.json b/biome.json index 7c6feabf7..4663b8ca1 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.1.4/schema.json", + "$schema": "https://biomejs.dev/schemas/2.2.0/schema.json", "assist": { "actions": { "source": { @@ -32,8 +32,19 @@ }, "rules": { "recommended": true, - "suspicious": { - "noConsole": "error" + "a11y": { + "useKeyWithClickEvents": "off", + "useSemanticElements": "off" + }, + "correctness": { + "noUnusedFunctionParameters": "error", + "useExhaustiveDependencies": { + "level": "warn", + "options": { + "hooks": [{ "name": "useNavigate", "stableResult": true }] + } + }, + "useUniqueElementIds": "warn" }, "style": { "useDefaultSwitchClause": "error", @@ -48,21 +59,9 @@ "noInferrableTypes": "error", "noUselessElse": "error" }, - "a11y": { - "useKeyWithClickEvents": "off", - "useSemanticElements": "off" - }, - "correctness": { - "noUnusedFunctionParameters": "error", - "useExhaustiveDependencies": { - "level": "warn", - "options": { - "hooks": [{ "name": "useNavigate", "stableResult": true }] - } - } - }, - "nursery": { - "useUniqueElementIds": "warn" + "suspicious": { + "noConsole": "error", + "noUnknownAtRules": "warn" } } }, diff --git a/package.json b/package.json index a9db1f3d6..bb9c2881b 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "update-electron-app": "3.1.1" }, "devDependencies": { - "@biomejs/biome": "2.1.4", + "@biomejs/biome": "2.2.0", "@discordapp/twemoji": "16.0.1", "@electron/notarize": "3.0.2", "@primer/octicons-react": "19.15.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e651f9149..e892500a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,8 +34,8 @@ importers: version: 3.1.1 devDependencies: '@biomejs/biome': - specifier: 2.1.4 - version: 2.1.4 + specifier: 2.2.0 + version: 2.2.0 '@discordapp/twemoji': specifier: 16.0.1 version: 16.0.1 @@ -370,55 +370,55 @@ packages: '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - '@biomejs/biome@2.1.4': - resolution: {integrity: sha512-QWlrqyxsU0FCebuMnkvBIkxvPqH89afiJzjMl+z67ybutse590jgeaFdDurE9XYtzpjRGTI1tlUZPGWmbKsElA==} + '@biomejs/biome@2.2.0': + resolution: {integrity: sha512-3On3RSYLsX+n9KnoSgfoYlckYBoU6VRM22cw1gB4Y0OuUVSYd/O/2saOJMrA4HFfA1Ff0eacOvMN1yAAvHtzIw==} engines: {node: '>=14.21.3'} hasBin: true - '@biomejs/cli-darwin-arm64@2.1.4': - resolution: {integrity: sha512-sCrNENE74I9MV090Wq/9Dg7EhPudx3+5OiSoQOkIe3DLPzFARuL1dOwCWhKCpA3I5RHmbrsbNSRfZwCabwd8Qg==} + '@biomejs/cli-darwin-arm64@2.2.0': + resolution: {integrity: sha512-zKbwUUh+9uFmWfS8IFxmVD6XwqFcENjZvEyfOxHs1epjdH3wyyMQG80FGDsmauPwS2r5kXdEM0v/+dTIA9FXAg==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] - '@biomejs/cli-darwin-x64@2.1.4': - resolution: {integrity: sha512-gOEICJbTCy6iruBywBDcG4X5rHMbqCPs3clh3UQ+hRKlgvJTk4NHWQAyHOXvaLe+AxD1/TNX1jbZeffBJzcrOw==} + '@biomejs/cli-darwin-x64@2.2.0': + resolution: {integrity: sha512-+OmT4dsX2eTfhD5crUOPw3RPhaR+SKVspvGVmSdZ9y9O/AgL8pla6T4hOn1q+VAFBHuHhsdxDRJgFCSC7RaMOw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] - '@biomejs/cli-linux-arm64-musl@2.1.4': - resolution: {integrity: sha512-nYr7H0CyAJPaLupFE2cH16KZmRC5Z9PEftiA2vWxk+CsFkPZQ6dBRdcC6RuS+zJlPc/JOd8xw3uCCt9Pv41WvQ==} + '@biomejs/cli-linux-arm64-musl@2.2.0': + resolution: {integrity: sha512-egKpOa+4FL9YO+SMUMLUvf543cprjevNc3CAgDNFLcjknuNMcZ0GLJYa3EGTCR2xIkIUJDVneBV3O9OcIlCEZQ==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-arm64@2.1.4': - resolution: {integrity: sha512-juhEkdkKR4nbUi5k/KRp1ocGPNWLgFRD4NrHZSveYrD6i98pyvuzmS9yFYgOZa5JhaVqo0HPnci0+YuzSwT2fw==} + '@biomejs/cli-linux-arm64@2.2.0': + resolution: {integrity: sha512-6eoRdF2yW5FnW9Lpeivh7Mayhq0KDdaDMYOJnH9aT02KuSIX5V1HmWJCQQPwIQbhDh68Zrcpl8inRlTEan0SXw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-x64-musl@2.1.4': - resolution: {integrity: sha512-lvwvb2SQQHctHUKvBKptR6PLFCM7JfRjpCCrDaTmvB7EeZ5/dQJPhTYBf36BE/B4CRWR2ZiBLRYhK7hhXBCZAg==} + '@biomejs/cli-linux-x64-musl@2.2.0': + resolution: {integrity: sha512-I5J85yWwUWpgJyC1CcytNSGusu2p9HjDnOPAFG4Y515hwRD0jpR9sT9/T1cKHtuCvEQ/sBvx+6zhz9l9wEJGAg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-linux-x64@2.1.4': - resolution: {integrity: sha512-Eoy9ycbhpJVYuR+LskV9s3uyaIkp89+qqgqhGQsWnp/I02Uqg2fXFblHJOpGZR8AxdB9ADy87oFVxn9MpFKUrw==} + '@biomejs/cli-linux-x64@2.2.0': + resolution: {integrity: sha512-5UmQx/OZAfJfi25zAnAGHUMuOd+LOsliIt119x2soA2gLggQYrVPA+2kMUxR6Mw5M1deUF/AWWP2qpxgH7Nyfw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-win32-arm64@2.1.4': - resolution: {integrity: sha512-3WRYte7orvyi6TRfIZkDN9Jzoogbv+gSvR+b9VOXUg1We1XrjBg6WljADeVEaKTvOcpVdH0a90TwyOQ6ue4fGw==} + '@biomejs/cli-win32-arm64@2.2.0': + resolution: {integrity: sha512-n9a1/f2CwIDmNMNkFs+JI0ZjFnMO0jdOyGNtihgUNFnlmd84yIYY2KMTBmMV58ZlVHjgmY5Y6E1hVTnSRieggA==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] - '@biomejs/cli-win32-x64@2.1.4': - resolution: {integrity: sha512-tBc+W7anBPSFXGAoQW+f/+svkpt8/uXfRwDzN1DvnatkRMt16KIYpEi/iw8u9GahJlFv98kgHcIrSsZHZTR0sw==} + '@biomejs/cli-win32-x64@2.2.0': + resolution: {integrity: sha512-Nawu5nHjP/zPKTIryh2AavzTc/KEg4um/MxWdXW0A6P/RZOyIpa7+QSjeXwAwX/utJGaCoXRPWtF3m5U/bB3Ww==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] @@ -4953,39 +4953,39 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} - '@biomejs/biome@2.1.4': + '@biomejs/biome@2.2.0': optionalDependencies: - '@biomejs/cli-darwin-arm64': 2.1.4 - '@biomejs/cli-darwin-x64': 2.1.4 - '@biomejs/cli-linux-arm64': 2.1.4 - '@biomejs/cli-linux-arm64-musl': 2.1.4 - '@biomejs/cli-linux-x64': 2.1.4 - '@biomejs/cli-linux-x64-musl': 2.1.4 - '@biomejs/cli-win32-arm64': 2.1.4 - '@biomejs/cli-win32-x64': 2.1.4 - - '@biomejs/cli-darwin-arm64@2.1.4': + '@biomejs/cli-darwin-arm64': 2.2.0 + '@biomejs/cli-darwin-x64': 2.2.0 + '@biomejs/cli-linux-arm64': 2.2.0 + '@biomejs/cli-linux-arm64-musl': 2.2.0 + '@biomejs/cli-linux-x64': 2.2.0 + '@biomejs/cli-linux-x64-musl': 2.2.0 + '@biomejs/cli-win32-arm64': 2.2.0 + '@biomejs/cli-win32-x64': 2.2.0 + + '@biomejs/cli-darwin-arm64@2.2.0': optional: true - '@biomejs/cli-darwin-x64@2.1.4': + '@biomejs/cli-darwin-x64@2.2.0': optional: true - '@biomejs/cli-linux-arm64-musl@2.1.4': + '@biomejs/cli-linux-arm64-musl@2.2.0': optional: true - '@biomejs/cli-linux-arm64@2.1.4': + '@biomejs/cli-linux-arm64@2.2.0': optional: true - '@biomejs/cli-linux-x64-musl@2.1.4': + '@biomejs/cli-linux-x64-musl@2.2.0': optional: true - '@biomejs/cli-linux-x64@2.1.4': + '@biomejs/cli-linux-x64@2.2.0': optional: true - '@biomejs/cli-win32-arm64@2.1.4': + '@biomejs/cli-win32-arm64@2.2.0': optional: true - '@biomejs/cli-win32-x64@2.1.4': + '@biomejs/cli-win32-x64@2.2.0': optional: true '@cspotcode/source-map-support@0.8.1': diff --git a/src/renderer/__mocks__/electron.js b/src/renderer/__mocks__/electron.js index 2a8783e58..9754ee944 100644 --- a/src/renderer/__mocks__/electron.js +++ b/src/renderer/__mocks__/electron.js @@ -1,6 +1,5 @@ const { namespacedEvent } = require('../../shared/events'); -// @ts-ignore window.Notification = function (title) { this.title = title; @@ -9,7 +8,6 @@ window.Notification = function (title) { }; }; -// @ts-ignore window.Audio = class Audio { constructor(path) { this.path = path; @@ -18,7 +16,6 @@ window.Audio = class Audio { play() {} }; -// @ts-ignore window.localStorage = { store: {}, getItem: function (key) { diff --git a/src/renderer/hooks/useInterval.ts b/src/renderer/hooks/useInterval.ts index f96a9a90a..5686f3af1 100644 --- a/src/renderer/hooks/useInterval.ts +++ b/src/renderer/hooks/useInterval.ts @@ -1,7 +1,7 @@ import { useEffect, useRef } from 'react'; // Thanks to https://overreacted.io/making-setinterval-declarative-with-react-hooks/ -export const useInterval = (callback, delay) => { +export const useInterval = (callback, delay: number) => { const savedCallback = useRef(null); // Remember the latest callback. @@ -12,7 +12,6 @@ export const useInterval = (callback, delay) => { // Set up the interval. useEffect(() => { function tick() { - // @ts-ignore savedCallback.current(); }