[PR #30444] chore: integrate @tanstack/eslint-plugin-query and fix service layer lint errors #32821

Closed
opened 2026-02-21 20:52:08 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/30444

State: closed
Merged: Yes


Summary

This PR integrates @tanstack/eslint-plugin-query to improve code quality and reliability by enforcing React Query best practices. It also resolves multiple exhaustive-deps violations identified in the service/ directory.

Changes

  • Dependency: Added @tanstack/eslint-plugin-query as a dev dependency.
  • Configuration: Updated eslint.config.mjs to enable the flat/recommended rule set.
  • Refactoring: Fixed missing dependencies in queryKey across multiple service hooks to ensure data freshness and correct caching behavior.

Fix Details

Fixed exhaustive-deps errors in the following files by ensuring all external variables used in queryFn are included in the queryKey:

  • service/use-apps.ts
  • service/use-explore.ts
  • service/use-models.ts
  • service/use-pipeline.ts
  • service/use-plugins.ts
  • service/knowledge/use-segment.ts
  • service/access-control.ts
  • service/knowledge/use-document.ts
  • app/components/goto-anything/index.tsx

Related Issue

Closes #30443

**Original Pull Request:** https://github.com/langgenius/dify/pull/30444 **State:** closed **Merged:** Yes --- ## Summary This PR integrates `@tanstack/eslint-plugin-query` to improve code quality and reliability by enforcing React Query best practices. It also resolves multiple `exhaustive-deps` violations identified in the `service/` directory. ## Changes - **Dependency**: Added `@tanstack/eslint-plugin-query` as a dev dependency. - **Configuration**: Updated `eslint.config.mjs` to enable the `flat/recommended` rule set. - **Refactoring**: Fixed missing dependencies in `queryKey` across multiple service hooks to ensure data freshness and correct caching behavior. ## Fix Details Fixed `exhaustive-deps` errors in the following files by ensuring all external variables used in `queryFn` are included in the `queryKey`: - `service/use-apps.ts` - `service/use-explore.ts` - `service/use-models.ts` - `service/use-pipeline.ts` - `service/use-plugins.ts` - `service/knowledge/use-segment.ts` - `service/access-control.ts` - `service/knowledge/use-document.ts` - `app/components/goto-anything/index.tsx` ## Related Issue Closes #30443
yindo added the pull-request label 2026-02-21 20:52:08 -05:00
yindo closed this issue 2026-02-21 20:52:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32821