Skip to content

[eslint] Package#4088

Merged
m-bert merged 2 commits into@mbert/more-eslintfrom
@mbert/more-eslint-package
Apr 14, 2026
Merged

[eslint] Package#4088
m-bert merged 2 commits into@mbert/more-eslintfrom
@mbert/more-eslint-package

Conversation

@m-bert
Copy link
Copy Markdown
Collaborator

@m-bert m-bert commented Apr 14, 2026

Description

This PR fixes eslint errors in package after enabling new import rules

Test plan

  • yarn ts-check
  • yarn lint-js

I've also run Sonnet to make sure that only imports were affected:

image

Copilot AI review requested due to automatic review settings April 14, 2026 12:40
@m-bert m-bert requested review from coado and j-piasecki April 14, 2026 12:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses newly enabled ESLint import/* rules by normalizing import ordering and converting many type-only imports across the react-native-gesture-handler package (web + v3 + legacy codepaths) to eliminate lint errors.

Changes:

  • Convert many imports to import type where appropriate and reorder imports to satisfy ESLint rules.
  • Separate type imports from value imports to reduce runtime imports and align with new lint constraints.
  • Apply the same import hygiene updates across source, specs/codegen, mocks, and tests.

Reviewed changes

Copilot reviewed 176 out of 176 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/react-native-gesture-handler/src/web/utils.ts Import ordering / type-only import cleanup
packages/react-native-gesture-handler/src/web/tools/WheelEventManager.ts Type-only import split for interfaces
packages/react-native-gesture-handler/src/web/tools/VelocityTracker.ts Convert event type import to import type
packages/react-native-gesture-handler/src/web/tools/Vector.ts Convert PointerTracker import to type-only
packages/react-native-gesture-handler/src/web/tools/PointerTracker.ts Convert interfaces import to type-only
packages/react-native-gesture-handler/src/web/tools/PointerEventManager.ts Reorder imports; split type/value imports
packages/react-native-gesture-handler/src/web/tools/NodeManager.ts Convert imports to type-only (but introduces a typeof type-query issue)
packages/react-native-gesture-handler/src/web/tools/KeyboardEventManager.ts Split AdaptedEvent into type-only import
packages/react-native-gesture-handler/src/web/tools/InteractionManager.ts Split type/value imports from interfaces / v3/types
packages/react-native-gesture-handler/src/web/tools/GestureHandlerWebDelegate.ts Import reordering and type-only conversion
packages/react-native-gesture-handler/src/web/tools/GestureHandlerOrchestrator.ts Import reordering
packages/react-native-gesture-handler/src/web/tools/EventManager.ts Convert event types import to type-only
packages/react-native-gesture-handler/src/web/interfaces.ts Convert many imports to type-only
packages/react-native-gesture-handler/src/web/handlers/TapGestureHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/web/handlers/RotationGestureHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/web/handlers/PinchGestureHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/web/handlers/PanGestureHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/web/handlers/NativeViewGestureHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/web/handlers/ManualGestureHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/web/handlers/LongPressGestureHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/web/handlers/IGestureHandler.ts Convert SingleGestureName/State imports to type-only
packages/react-native-gesture-handler/src/web/handlers/HoverGestureHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/web/handlers/GestureHandler.ts Large import reorder + type-only conversions
packages/react-native-gesture-handler/src/web/handlers/FlingGestureHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/web/detectors/ScaleGestureDetector.ts Split type/value imports
packages/react-native-gesture-handler/src/web/detectors/RotationGestureDetector.ts Split type/value imports
packages/react-native-gesture-handler/src/web/Gestures.ts Import reordering
packages/react-native-gesture-handler/src/v3/types/UtilityTypes.ts Convert referenced types to type-only imports
packages/react-native-gesture-handler/src/v3/types/NativeWrapperType.ts Convert barrel imports to type-only
packages/react-native-gesture-handler/src/v3/types/GestureTypes.ts Convert referenced types to type-only imports
packages/react-native-gesture-handler/src/v3/types/EventTypes.ts Convert RN imports to type-only
packages/react-native-gesture-handler/src/v3/types/DetectorTypes.ts Convert referenced types to type-only imports
packages/react-native-gesture-handler/src/v3/types/ConfigTypes.ts Convert referenced types to type-only imports
packages/react-native-gesture-handler/src/v3/hooks/utils/relationUtils.ts Convert referenced types to type-only imports
packages/react-native-gesture-handler/src/v3/hooks/utils/reanimatedUtils.ts Reorder imports; split type/value imports
packages/react-native-gesture-handler/src/v3/hooks/utils/propsWhiteList.ts Split type/value imports (notably SingleGestureName)
packages/react-native-gesture-handler/src/v3/hooks/utils/eventUtils.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/utils/eventHandlersUtils.ts Reorder imports; split type/value imports
packages/react-native-gesture-handler/src/v3/hooks/utils/configUtils.ts Reorder imports; split type/value imports
packages/react-native-gesture-handler/src/v3/hooks/useGestureCallbacks.ts Reorder imports; split type/value imports
packages/react-native-gesture-handler/src/v3/hooks/useGesture.ts Reorder imports; split type/value imports
packages/react-native-gesture-handler/src/v3/hooks/gestures/tap/useTapGesture.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/gestures/tap/TapTypes.ts Convert referenced types to type-only imports
packages/react-native-gesture-handler/src/v3/hooks/gestures/rotation/useRotationGesture.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/gestures/rotation/RotationTypes.ts Convert referenced types to type-only imports
packages/react-native-gesture-handler/src/v3/hooks/gestures/pinch/usePinchGesture.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/gestures/pinch/PinchTypes.ts Convert referenced types to type-only imports
packages/react-native-gesture-handler/src/v3/hooks/gestures/pan/usePanGesture.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/gestures/pan/PanTypes.ts Convert referenced types to type-only imports
packages/react-native-gesture-handler/src/v3/hooks/gestures/native/useNativeGesture.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/gestures/native/NativeTypes.ts Convert referenced types to type-only imports
packages/react-native-gesture-handler/src/v3/hooks/gestures/manual/useManualGesture.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/gestures/manual/ManualTypes.ts Convert referenced types to type-only imports
packages/react-native-gesture-handler/src/v3/hooks/gestures/longPress/useLongPressGesture.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/gestures/longPress/LongPressTypes.ts Convert referenced types to type-only imports
packages/react-native-gesture-handler/src/v3/hooks/gestures/index.ts Type-only export ordering adjustments
packages/react-native-gesture-handler/src/v3/hooks/gestures/hover/useHoverGesture.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/gestures/hover/HoverTypes.ts Convert referenced types to type-only imports
packages/react-native-gesture-handler/src/v3/hooks/gestures/fling/useFlingGesture.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/gestures/fling/FlingTypes.ts Convert referenced types to type-only imports
packages/react-native-gesture-handler/src/v3/hooks/composition/useSimultaneousGestures.ts Split type/value imports
packages/react-native-gesture-handler/src/v3/hooks/composition/useExclusiveGestures.ts Split type/value imports
packages/react-native-gesture-handler/src/v3/hooks/composition/useComposedGesture.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/composition/useCompetingGestures.ts Split type/value imports
packages/react-native-gesture-handler/src/v3/hooks/callbacks/useReanimatedEventHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/callbacks/useGestureEventHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/callbacks/updateHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/callbacks/touchEventHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/callbacks/stateChangeHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/hooks/callbacks/eventHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/gestureStateManager.web.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/detectors/utils.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/detectors/useEnsureGestureHandlerRootView.ts Import reordering
packages/react-native-gesture-handler/src/v3/detectors/common.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/detectors/VirtualDetector/useInterceptingDetectorContext.ts Convert VirtualChild to type-only import
packages/react-native-gesture-handler/src/v3/detectors/VirtualDetector/VirtualDetector.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/detectors/VirtualDetector/InterceptingGestureDetector.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/detectors/ReanimatedNativeDetector.web.tsx Import reordering
packages/react-native-gesture-handler/src/v3/detectors/ReanimatedNativeDetector.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/detectors/NativeDetector.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/detectors/HostGestureDetector.web.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/detectors/GestureDetector.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/createNativeWrapper.tsx Import reordering
packages/react-native-gesture-handler/src/v3/components/Touchable/TouchableProps.ts Import reordering / type-only imports
packages/react-native-gesture-handler/src/v3/components/Touchable/Touchable.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/components/Pressable.tsx Large import reorder + type-only conversions
packages/react-native-gesture-handler/src/v3/components/GestureComponents.web.tsx Split type/value imports
packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/components/GestureButtonsProps.ts Convert component import to type-only (but introduces a typeof type-query issue)
packages/react-native-gesture-handler/src/v3/components/GestureButtons.tsx Import reordering / type-only imports
packages/react-native-gesture-handler/src/v3/NativeProxy.web.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/v3/NativeProxy.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/specs/RNGestureHandlerRootViewNativeComponent.ts Import ordering
packages/react-native-gesture-handler/src/specs/RNGestureHandlerDetectorNativeComponent.ts Import ordering
packages/react-native-gesture-handler/src/specs/RNGestureHandlerButtonNativeComponent.ts Import ordering
packages/react-native-gesture-handler/src/specs/NativeRNGestureHandlerModule.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/mountRegistry.ts Convert GestureType import to type-only
packages/react-native-gesture-handler/src/mocks/GestureButtons.tsx Import ordering
packages/react-native-gesture-handler/src/jestUtils/jestUtils.ts Large import reorder + type-only conversions
packages/react-native-gesture-handler/src/handlers/utils.ts Convert React namespace import to type-only and reorder
packages/react-native-gesture-handler/src/handlers/handlersRegistry.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/gestures/tapGesture.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/gestures/rotationGesture.ts Convert update event import to type-only
packages/react-native-gesture-handler/src/handlers/gestures/reanimatedWrapper.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/handlers/gestures/pinchGesture.ts Convert update event import to type-only
packages/react-native-gesture-handler/src/handlers/gestures/panGesture.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/gestures/nativeGesture.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/gestures/manualGesture.ts Convert update event import to type-only
packages/react-native-gesture-handler/src/handlers/gestures/longPressGesture.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/gestures/hoverGesture.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/gestures/gestureStateManager.web.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/handlers/gestures/gestureObjects.ts Import reordering + type-only conversion for Gesture
packages/react-native-gesture-handler/src/handlers/gestures/gestureComposition.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/gestures/gesture.ts Reorder imports; split type/value imports
packages/react-native-gesture-handler/src/handlers/gestures/forceTouchGesture.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/gestures/flingGesture.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/gestures/eventReceiver.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector/utils.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector/useViewRefHandler.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector/useMountReactions.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector/useDetectorUpdater.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector/useAnimatedGesture.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector/updateHandlers.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector/types.ts Convert imports to type-only
packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector/needsToReattach.ts Convert imports to type-only
packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector/index.tsx Import reordering + type-only conversions
packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector/dropHandlers.ts Import reordering + type-only conversions
packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector/attachHandlers.ts Import reordering + type-only conversions
packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector/Wrap.web.tsx Import updates (but introduces invalid module specifier for tagMessage)
packages/react-native-gesture-handler/src/handlers/gestureHandlerTypesCompat.ts Import reordering + type-only conversions
packages/react-native-gesture-handler/src/handlers/gestureHandlerCommon.ts Convert imports to type-only (but introduces a typeof type-query issue)
packages/react-native-gesture-handler/src/handlers/createNativeWrapper.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/handlers/createHandler.tsx Large import reorder + type-only conversions
packages/react-native-gesture-handler/src/handlers/TapGestureHandler.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/RotationGestureHandler.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/PinchGestureHandler.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/PanGestureHandler.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/NativeViewGestureHandler.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/LongPressGestureHandler.ts Split type/value imports
packages/react-native-gesture-handler/src/handlers/GestureHandlerEventPayload.ts Convert StylusData import to type-only
packages/react-native-gesture-handler/src/handlers/ForceTouchGestureHandler.ts Import reordering + type-only conversions
packages/react-native-gesture-handler/src/handlers/FlingGestureHandler.ts Split type/value imports
packages/react-native-gesture-handler/src/findNodeHandle.web.ts Import reordering + type-only conversions
packages/react-native-gesture-handler/src/components/utils.ts Convert gesture types import to type-only
packages/react-native-gesture-handler/src/components/touchables/TouchableWithoutFeedback.tsx Split type/value imports
packages/react-native-gesture-handler/src/components/touchables/TouchableOpacity.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/components/touchables/TouchableNativeFeedbackProps.tsx Split type/value imports
packages/react-native-gesture-handler/src/components/touchables/TouchableNativeFeedback.android.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/components/touchables/TouchableHighlight.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/components/touchables/GenericTouchableProps.ts Split type/value imports
packages/react-native-gesture-handler/src/components/touchables/GenericTouchable.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/components/Text.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/components/ReanimatedSwipeable/ReanimatedSwipeableProps.ts Convert imports to type-only
packages/react-native-gesture-handler/src/components/ReanimatedSwipeable/ReanimatedSwipeable.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/components/ReanimatedDrawerLayout.tsx Large import reorder + type-only conversions
packages/react-native-gesture-handler/src/components/Pressable/utils.ts Import reordering + type-only conversions
packages/react-native-gesture-handler/src/components/Pressable/stateDefinitions.ts Convert imports to type-only
packages/react-native-gesture-handler/src/components/Pressable/StateMachine.tsx Convert import to type-only
packages/react-native-gesture-handler/src/components/Pressable/PressableProps.tsx Split type/value imports
packages/react-native-gesture-handler/src/components/Pressable/Pressable.tsx Large import reorder + type-only conversions
packages/react-native-gesture-handler/src/components/GestureHandlerRootView.web.tsx Split type/value imports
packages/react-native-gesture-handler/src/components/GestureHandlerRootView.tsx Split type/value imports
packages/react-native-gesture-handler/src/components/GestureHandlerRootView.android.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/components/GestureHandlerButton.web.tsx Split type/value imports
packages/react-native-gesture-handler/src/components/GestureHandlerButton.tsx Convert RN imports to type-only
packages/react-native-gesture-handler/src/components/GestureComponents.web.tsx Split type/value imports
packages/react-native-gesture-handler/src/components/GestureComponents.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/components/GestureButtonsProps.ts Convert React/RN imports to type-only
packages/react-native-gesture-handler/src/components/GestureButtons.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/tests/mocks.test.tsx Import reordering
packages/react-native-gesture-handler/src/tests/api_v3.test.tsx Import reordering
packages/react-native-gesture-handler/src/tests/RelationsTraversal.test.tsx Import reordering + type-only conversion
packages/react-native-gesture-handler/src/tests/Events.test.tsx Split type/value imports and reorder
packages/react-native-gesture-handler/src/tests/Errors.test.tsx Import reordering
packages/react-native-gesture-handler/src/RNGestureHandlerModule.windows.ts Split type/value imports and reorder
packages/react-native-gesture-handler/src/RNGestureHandlerModule.web.ts Split type/value imports and reorder

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/react-native-gesture-handler/src/web/tools/NodeManager.ts
Copy link
Copy Markdown
Contributor

@coado coado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legend

@m-bert m-bert merged commit f5591b3 into @mbert/more-eslint Apr 14, 2026
3 checks passed
@m-bert m-bert deleted the @mbert/more-eslint-package branch April 14, 2026 14:12
m-bert added a commit that referenced this pull request Apr 15, 2026
## Description

This PR aims to add new eslint rules, that:

- Require sorted imports
- Require `type` when importing only types

As there would be too many changes, I've decided to split this into two
PRs. This one will be base, similarly as in monorepo migration.

-
#4088
-
#4089

## Test plan

- `yarn lint-js`
- `yarn ts-check`

<img width="1069" height="482" alt="image"
src="https://github.com/user-attachments/assets/5f4e79f6-ae0a-4ec4-9073-b23f89a0f569"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants