Skip to content

Commit 39ffe1e

Browse files
committed
lint
1 parent 21498a6 commit 39ffe1e

13 files changed

Lines changed: 27 additions & 22 deletions

File tree

packages/react-native-reanimated/src/WorkletEventHandlerBase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type JSEvent<Event extends object> = NativeSyntheticEvent<EventPayload<Event>>;
1212
// In JS implementation (e.g. for web) we don't use Reanimated's
1313
// event emitter, therefore we have to handle here
1414
// the event that came from React Native and convert it.
15-
export function jsListener<Event extends object>(
15+
function jsListener<Event extends object>(
1616
eventName: string,
1717
handler: (event: ReanimatedEvent<Event>) => void
1818
) {

packages/react-native-reanimated/src/animation/utilBase.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ import {
4747
* object to prevent from freezing it in development.
4848
*/
4949
export const IN_STYLE_UPDATER = { current: false };
50-
export const IN_STYLE_UPDATER_UI = createSerializable({ current: false });
50+
const IN_STYLE_UPDATER_UI = createSerializable({ current: false });
5151
// is-tree-shakable-suppress
5252
serializableMappingCache.set(IN_STYLE_UPDATER, IN_STYLE_UPDATER_UI);
5353

54-
export const LAYOUT_ANIMATION_SUPPORTED_PROPS = {
54+
const LAYOUT_ANIMATION_SUPPORTED_PROPS = {
5555
originX: true,
5656
originY: true,
5757
width: true,
@@ -64,7 +64,7 @@ export const LAYOUT_ANIMATION_SUPPORTED_PROPS = {
6464
backgroundColor: true,
6565
};
6666

67-
export type LayoutAnimationProp = keyof typeof LAYOUT_ANIMATION_SUPPORTED_PROPS;
67+
type LayoutAnimationProp = keyof typeof LAYOUT_ANIMATION_SUPPORTED_PROPS;
6868

6969
export function isValidLayoutAnimationProp(prop: string) {
7070
'worklet';
@@ -85,7 +85,7 @@ export function initialUpdaterRun<T>(updater: () => T) {
8585
return result;
8686
}
8787

88-
export interface RecognizedPrefixSuffix {
88+
interface RecognizedPrefixSuffix {
8989
prefix?: string;
9090
suffix?: string;
9191
strippedValue: number;

packages/react-native-reanimated/src/common/constants/platform.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ export const IS_WEB: boolean = Platform?.OS === 'web';
1616
export const IS_JEST: boolean =
1717
typeof globalThis.jest !== 'undefined' || process.env.NODE_ENV === 'test';
1818
/** @knipIgnore */
19+
// is-tree-shakable-suppress
1920
export const IS_WINDOWS: boolean = Platform?.OS === 'windows';
2021

2122
export const IS_WINDOW_AVAILABLE: boolean = isWindowAvailable();
2223

24+
/** @knipIgnore */
2325
export const SHOULD_BE_USE_WEB = IS_JEST || IS_WEB || IS_WINDOWS;

packages/react-native-reanimated/src/common/style/propsBuilder.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export function createNativePropsBuilder<TProps extends UnknownRecord>(
4949

5050
export type NativePropsBuilder = ReturnType<typeof createNativePropsBuilder>;
5151

52+
// is-tree-shakable-suppress
5253
export const stylePropsBuilder = createNativePropsBuilder(
5354
STYLE_PROPERTIES_CONFIG
5455
);

packages/react-native-reanimated/src/createAnimatedComponent/AnimatedComponent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import { filterStyles, flattenArray } from './utils';
4343

4444
let id = 0;
4545

46+
// is-tree-shakable-suppress
4647
configureWebLayoutAnimations();
4748

4849
export type Options<P> = {

packages/react-native-reanimated/src/hook/useAnimatedStyleBase.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type { ViewDescriptorsSet } from '../ViewDescriptorsSet';
1717
import type { Descriptor } from './commonTypes';
1818
import { isAnimated, shallowEqual } from './utils';
1919

20-
export interface AnimatedState {
20+
interface AnimatedState {
2121
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2222
last: AnimatedStyle<any>;
2323
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -38,7 +38,7 @@ export interface AnimatedUpdaterData {
3838
styleUpdaterContainer: StyleUpdaterContainer;
3939
}
4040

41-
export function prepareAnimation(
41+
function prepareAnimation(
4242
frameTimestamp: number,
4343
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4444
animatedProp: AnimatedStyle<any>,
@@ -101,7 +101,7 @@ export function prepareAnimation(
101101
}
102102
}
103103

104-
export function runAnimations(
104+
function runAnimations(
105105
// eslint-disable-next-line @typescript-eslint/no-explicit-any
106106
animation: AnimatedStyle<any>,
107107
timestamp: Timestamp,

packages/react-native-reanimated/src/hook/useHandlerBase.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { isWorkletFunction } from 'react-native-worklets';
55
import type { UnknownRecord } from '../common';
66
import type { ReanimatedEvent } from './commonTypes';
77

8-
export interface GeneralHandler<
8+
interface GeneralHandler<
99
TEvent extends object,
1010
TContext extends UnknownRecord,
1111
> {
@@ -38,16 +38,16 @@ export function ensureWorkletHandlers(handlers: UnknownRecord) {
3838
}
3939
}
4040

41-
export const objectIs: (a: unknown, b: unknown) => boolean =
41+
const objectIs: (a: unknown, b: unknown) => boolean =
4242
typeof Object.is === 'function'
4343
? Object.is
4444
: (x, y) =>
4545
(x === y && (x !== 0 || 1 / (x as number) === 1 / (y as number))) ||
4646
(Number.isNaN(x as number) && Number.isNaN(y as number));
4747

48-
export type WorkletClosure = Record<string, unknown>;
48+
type WorkletClosure = Record<string, unknown>;
4949

50-
export function areWorkletClosuresEqual(
50+
function areWorkletClosuresEqual(
5151
next: WorkletClosure,
5252
prev: WorkletClosure
5353
): boolean {
@@ -60,7 +60,7 @@ export function areWorkletClosuresEqual(
6060
);
6161
}
6262

63-
export function areWorkletsEqual(
63+
function areWorkletsEqual(
6464
next: WorkletFunction,
6565
prev: WorkletFunction
6666
): boolean {

packages/react-native-reanimated/src/mutablesBase.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ export function checkInvalidWriteDuringRender() {
2929
}
3030
}
3131

32-
export type Listener<TValue> = (newValue: TValue) => void;
32+
type Listener<TValue> = (newValue: TValue) => void;
3333

34-
export type PartialMutable<TValue> = Omit<Mutable<TValue>, 'get' | 'set'>;
34+
type PartialMutable<TValue> = Omit<Mutable<TValue>, 'get' | 'set'>;
3535

3636
/**
3737
* Adds `get` and `set` methods to the mutable object to handle access to

packages/react-native-reanimated/src/platformFunctions/measure.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict';
22
import { logger } from '../common';
3-
import type { InternalHostInstance, MeasuredDimensions } from '../commonTypes';
3+
import type { InstanceOrElement, MeasuredDimensions } from '../commonTypes';
44
import type { AnimatedRef } from '../hook/commonTypes';
55

6-
export function measure<TRef extends InternalHostInstance>(
6+
export function measure<TRef extends InstanceOrElement>(
77
animatedRef: AnimatedRef<TRef>
88
): MeasuredDimensions | null {
99
const element = animatedRef() as HTMLElement | null;

packages/react-native-reanimated/src/platformFunctions/scrollTo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import type { ComponentRef } from 'react';
33
import type { ScrollView } from 'react-native';
44

55
import { logger } from '../common';
6-
import type { InternalHostInstance } from '../commonTypes';
6+
import type { InstanceOrElement } from '../commonTypes';
77
import type { AnimatedRef } from '../hook/commonTypes';
88

9-
export function scrollTo<TRef extends InternalHostInstance>(
9+
export function scrollTo<TRef extends InstanceOrElement>(
1010
animatedRef: AnimatedRef<TRef>,
1111
x: number,
1212
y: number,

0 commit comments

Comments
 (0)