Skip to content

Commit 63cc90e

Browse files
committed
chore: fix lint issues
1 parent 41a21fb commit 63cc90e

File tree

7 files changed

+12
-14
lines changed

7 files changed

+12
-14
lines changed

src/__tests__/render-hook.test.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
22
import TestRenderer from 'react-test-renderer';
33
import { renderHook } from '../pure';
44

5-
test('gives comitted result', () => {
5+
test('gives committed result', () => {
66
const { result } = renderHook(() => {
77
const [state, setState] = React.useState(1);
88

@@ -22,13 +22,11 @@ test('allows rerendering', () => {
2222
const [left, setLeft] = React.useState('left');
2323
const [right, setRight] = React.useState('right');
2424

25-
// eslint-disable-next-line jest/no-if
2625
switch (props.branch) {
2726
case 'left':
2827
return [left, setLeft];
2928
case 'right':
3029
return [right, setRight];
31-
3230
default:
3331
throw new Error('No Props passed. This is a bug in the implementation');
3432
}
@@ -64,7 +62,7 @@ const useMyHook = (param: number | undefined) => {
6462
return param;
6563
};
6664

67-
test('props type is infered correctly when initial props is defined', () => {
65+
test('props type is inferred correctly when initial props is defined', () => {
6866
const { result, rerender } = renderHook((num: number | undefined) => useMyHook(num), {
6967
initialProps: 5,
7068
});

src/__tests__/wait-for-element-to-be-removed.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ test('waits with custom interval', async () => {
114114
timeout: 600,
115115
interval: 200,
116116
});
117-
} catch (e) {
117+
} catch {
118118
// Suppress expected error
119119
}
120120

@@ -133,7 +133,7 @@ test.each([false, true])(
133133
timeout: 400,
134134
interval: 200,
135135
});
136-
} catch (e) {
136+
} catch {
137137
// Suppress expected error
138138
}
139139

src/__tests__/wait-for.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ test('waits for element with custom interval', async () => {
9191

9292
try {
9393
await waitFor(() => mockFn(), { timeout: 400, interval: 200 });
94-
} catch (e) {
94+
} catch {
9595
// suppress
9696
}
9797

@@ -160,7 +160,7 @@ test.each([false, true])(
160160

161161
try {
162162
await waitFor(() => mockFn(), { timeout: 400, interval: 200 });
163-
} catch (error) {
163+
} catch {
164164
// suppress
165165
}
166166

@@ -185,7 +185,7 @@ test.each([false, true])(
185185
interval: 200,
186186
onTimeout: mockHandleFn,
187187
});
188-
} catch (error) {
188+
} catch {
189189
// suppress
190190
}
191191

@@ -248,7 +248,7 @@ test.each([false, true])(
248248

249249
try {
250250
await waitFor(() => mockFn(), { timeout: 400, interval: 200 });
251-
} catch (error) {
251+
} catch {
252252
// suppress
253253
}
254254

src/matchers/utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class HostElementTypeError extends Error {
2525
try {
2626
withType = printWithType('Received', received, printReceived);
2727
/* istanbul ignore next */
28-
} catch (e) {
28+
} catch {
2929
// Deliberately empty.
3030
}
3131

src/queries/unsafe-props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const UNSAFE_queryAllByProps =
4646
(props: { [propName: string]: any }) => {
4747
try {
4848
return UNSAFE_getAllByProps(instance)(props);
49-
} catch (error) {
49+
} catch {
5050
return [];
5151
}
5252
};

src/queries/unsafe-type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const UNSAFE_queryAllByType =
4141
(type: React.ComponentType<any>) => {
4242
try {
4343
return UNSAFE_getAllByType(instance)(type);
44-
} catch (error) {
44+
} catch {
4545
return [];
4646
}
4747
};

src/wait-for-element-to-be-removed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default async function waitForElementToBeRemoved<T>(
2929
let result;
3030
try {
3131
result = expectation();
32-
} catch (error) {
32+
} catch {
3333
return initialElements;
3434
}
3535

0 commit comments

Comments
 (0)