Skip to content

Commit

Permalink
fixing tests after eslint bump
Browse files Browse the repository at this point in the history
Signed-off-by: Eder Ignatowicz <[email protected]>
  • Loading branch information
ederign committed Sep 10, 2024
1 parent c0b0f3c commit 077e67d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion clients/ui/frontend/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
"no-only-tests/no-only-tests": "error",
"@typescript-eslint/default-param-last": "error",
"@typescript-eslint/dot-notation": ["error", { "allowKeywords": true }],
"@typescript-eslint/lines-between-class-members": ["error", "always"],
"@typescript-eslint/method-signature-style": "error",
"@typescript-eslint/naming-convention": [
"error",
Expand Down
12 changes: 3 additions & 9 deletions clients/ui/frontend/src/__tests__/unit/testUtils/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@ import {
} from '@testing-library/react';
import { queries, Queries } from '@testing-library/dom';

export type BooleanValues<T> = T extends
| boolean
| number
| string
| null
| undefined
// eslint-disable-next-line @typescript-eslint/ban-types
| Function
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
export type BooleanValues<T> = T extends boolean | number | null | undefined | Function
? boolean | undefined
: boolean | undefined | { [K in keyof T]?: BooleanValues<T[K]> };

Expand Down Expand Up @@ -174,7 +168,7 @@ export const createComparativeValue = <T>(source: T, booleanTarget: BooleanValue

const createComparativeValueRecursive = <T>(
source: unknown,
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
booleanTarget: boolean | string | number | Function | BooleanValues<T>,
) => {
if (typeof booleanTarget === 'boolean') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const BrowserStorageContextProvider: React.FC<BrowserStorageContextProvid
if (parseJSON) {
try {
return JSON.parse(value);
} catch (e) {
} catch {
/* eslint-disable-next-line no-console */
console.warn(`Failed to parse storage value "${key}"`);
return null;
Expand All @@ -122,7 +122,7 @@ export const BrowserStorageContextProvider: React.FC<BrowserStorageContextProvid
setValues((oldValues) => ({ ...oldValues, [storageKey]: storageValue }));

return true;
} catch (e) {
} catch {
/* eslint-disable-next-line no-console */
console.warn(
'Could not store a value because it was requested to be stringified but was an invalid value for stringification.',
Expand Down

0 comments on commit 077e67d

Please sign in to comment.