Skip to content

Commit a39bb64

Browse files
committed
18 to go
1 parent d282d14 commit a39bb64

File tree

8 files changed

+14
-8
lines changed

8 files changed

+14
-8
lines changed

eslint.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@ export default [
1515
},
1616
...callstackConfig,
1717
...tseslint.configs.strict,
18+
{
19+
rules: {
20+
'no-console': 'error',
21+
},
22+
},
1823
{
1924
files: ['**/*.test.{ts,tsx}', 'src/test-utils/**'],
2025
rules: {
26+
'react/no-multi-comp': 'off',
2127
'react-native/no-color-literals': 'off',
2228
'react-native/no-inline-styles': 'off',
2329
'react-native/no-raw-text': 'off',

src/__tests__/render.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-console */
21
import * as React from 'react';
32
import { Pressable, Text, TextInput, View } from 'react-native';
43
import { fireEvent, render, RenderAPI, screen } from '..';

src/__tests__/wait-for.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Banana extends React.Component<any> {
1919
}
2020
}
2121

22-
class BananaContainer extends React.Component<{}, any> {
22+
class BananaContainer extends React.Component<object, any> {
2323
state = { fresh: false };
2424

2525
onChangeFresh = async () => {
@@ -196,7 +196,7 @@ test.each([false, true])(
196196

197197
const blockThread = (timeToBlockThread: number, legacyFakeTimers: boolean) => {
198198
jest.useRealTimers();
199-
let end = Date.now() + timeToBlockThread;
199+
const end = Date.now() + timeToBlockThread;
200200

201201
while (Date.now() < end) {
202202
// do nothing

src/helpers/object.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export function pick<T extends {}>(object: T, keys: (keyof T)[]): Partial<T> {
1+
export function pick<T extends object>(object: T, keys: (keyof T)[]): Partial<T> {
22
const result: Partial<T> = {};
33
keys.forEach((key) => {
44
if (object[key] !== undefined) {

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ if (!process?.env?.RNTL_SKIP_AUTO_CLEANUP) {
1010
// if you don't like this then either import the `pure` module
1111
// or set the RNTL_SKIP_AUTO_CLEANUP env variable to 'true'.
1212
if (typeof afterEach === 'function') {
13-
// eslint-disable-next-line no-undef
1413
afterEach(async () => {
1514
await flushMicroTasks();
1615
cleanup();

src/render-hook.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export type RenderHookResult<Result, Props> = {
1010

1111
export type RenderHookOptions<Props> = {
1212
initialProps?: Props;
13+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1314
wrapper?: ComponentType<any>;
1415
};
1516

src/render.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ import { getQueriesForElement } from './within';
1919
export interface RenderOptions {
2020
/**
2121
* Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating
22-
* reusable custom render functions for common data providers.
22+
* reusable custom render functions for common data providers.
2323
*/
24+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2425
wrapper?: React.ComponentType<any>;
2526

2627
/**

src/wait-for.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ function waitForInternal<T>(
127127
try {
128128
const result = expectation();
129129

130-
// @ts-ignore result can be a promise
130+
// @ts-expect-error result can be a promise
131131
// eslint-disable-next-line promise/prefer-await-to-then
132132
if (typeof result?.then === 'function') {
133-
const promiseResult: Promise<T> = result as any;
133+
const promiseResult: Promise<T> = result as unknown as Promise<T>;
134134
promiseStatus = 'pending';
135135
// eslint-disable-next-line promise/catch-or-return, promise/prefer-await-to-then
136136
promiseResult.then(

0 commit comments

Comments
 (0)