Skip to content

Commit 47da527

Browse files
committed
chore: fix lint & typecheck
1 parent ea795ba commit 47da527

File tree

7 files changed

+23
-20
lines changed

7 files changed

+23
-20
lines changed

src/__tests__/fire-event.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
TouchableOpacity,
99
View,
1010
} from 'react-native';
11-
import { act, fireEvent, render, screen } from '..';
11+
import { fireEvent, render, screen } from '..';
1212
import '../matchers/extend-expect';
1313

1414
type OnPressComponentProps = {

src/helpers/component-tree.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export type HostTestInstance = ReactTestInstance & { type: string };
1010
* @param element The element to check.
1111
*/
1212
export function isHostElement(element?: ReactTestInstance | null): element is HostTestInstance {
13+
// @ts-expect-error element.type has incorrectly narrowed type.
1314
return typeof element?.type === 'string' && element.type !== 'CONTAINER';
1415
}
1516

src/matchers/__tests__/to-be-partially-checked.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { type AccessibilityRole, View } from 'react-native';
3-
import { render, screen, configure } from '../..';
3+
import { render, screen } from '../..';
44
import '../extend-expect';
55

66
function renderViewsWithRole(role: AccessibilityRole) {

src/matchers/to-be-busy.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import { checkHostElement, formatElement } from './utils';
66
export function toBeBusy(this: jest.MatcherContext, element: ReactTestInstance) {
77
checkHostElement(element, toBeBusy, this);
88

9-
console.log('🔴 toBeBusy', element.type, element.props);
10-
console.log('🔴 - computeAriaBusy', computeAriaBusy(element));
11-
129
return {
1310
pass: computeAriaBusy(element),
1411
message: () => {

src/queries/__tests__/hint-text.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { Pressable, Text, View } from 'react-native';
3-
import { configure, render, screen } from '../..';
3+
import { render, screen } from '../..';
44

55
const BUTTON_HINT = 'click this button';
66
const TEXT_HINT = 'static text';

src/render-act.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function renderWithAct(
1616
// This will be called synchronously.
1717
void act(() => {
1818
if (rendererOption == 'internal') {
19-
console.log(`💠 Test "${expect.getState().currentTestName}": using internal renderer`);
19+
// @ts-expect-error
2020
renderer = render(component) as ReactTestRenderer;
2121
} else {
2222
// @ts-expect-error TestRenderer.create is not typed correctly

src/renderer/reconciler.ts

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const hostConfig = {
104104
_hostContext: HostContext,
105105
internalHandle: OpaqueHandle,
106106
): Instance {
107-
console.log('🔷 createInstance', type, props);
107+
//console.log('🔷 createInstance', type, props);
108108
// console.log('- RootContainer:', rootContainer);
109109
// console.log('- HostContext:', _hostContext);
110110
// console.log('- InternalHandle:', internalHandle);
@@ -153,9 +153,9 @@ const hostConfig = {
153153
* If you don't want to do anything here, you should return `false`.
154154
*/
155155
finalizeInitialChildren(
156-
instance: Instance,
157-
type: Type,
158-
props: Props,
156+
_instance: Instance,
157+
_type: Type,
158+
_props: Props,
159159
_rootContainer: Container,
160160
_hostContext: HostContext,
161161
): boolean {
@@ -172,10 +172,10 @@ const hostConfig = {
172172
* See the meaning of `rootContainer` and `hostContext` in the `createInstance` documentation.
173173
*/
174174
prepareUpdate(
175-
instance: Instance,
176-
type: Type,
177-
oldProps: Props,
178-
newProps: Props,
175+
_instance: Instance,
176+
_type: Type,
177+
_oldProps: Props,
178+
_newProps: Props,
179179
_rootContainer: Container,
180180
_hostContext: HostContext,
181181
): UpdatePayload | null {
@@ -193,7 +193,7 @@ const hostConfig = {
193193
*
194194
* This method happens **in the render phase**. Do not mutate the tree from it.
195195
*/
196-
shouldSetTextContent(type: Type, props: Props): boolean {
196+
shouldSetTextContent(_type: Type, _props: Props): boolean {
197197
// TODO: what should RN do here?
198198
//console.log('🔷 shouldSetTextContent', type, props);
199199
return false;
@@ -206,7 +206,7 @@ const hostConfig = {
206206
*
207207
* This method happens **in the render phase**. Do not mutate the tree from it.
208208
*/
209-
getRootHostContext(rootContainer: Container): HostContext | null {
209+
getRootHostContext(_rootContainer: Container): HostContext | null {
210210
return { isInsideText: false };
211211
},
212212

@@ -449,9 +449,14 @@ const hostConfig = {
449449
*
450450
* If you never return `true` from `finalizeInitialChildren`, you can leave it empty.
451451
*/
452-
commitMount(instance: Instance, type: Type, props: Props, _internalHandle: OpaqueHandle): void {
453-
console.log('🔷 commitMount', type, props);
454-
console.log('🔷 - instance:', instance);
452+
commitMount(
453+
_instance: Instance,
454+
_type: Type,
455+
_props: Props,
456+
_internalHandle: OpaqueHandle,
457+
): void {
458+
// console.log('🔷 commitMount', type, props);
459+
// console.log('🔷 - instance:', instance);
455460
// noop
456461
},
457462

0 commit comments

Comments
 (0)