chore(eslint): enable @eslint-react/no-unnecessary-use-prefix rule#1058
Draft
carlosthe19916 wants to merge 5 commits into
Draft
chore(eslint): enable @eslint-react/no-unnecessary-use-prefix rule#1058carlosthe19916 wants to merge 5 commits into
carlosthe19916 wants to merge 5 commits into
Conversation
Rename functions that have 'use' prefix but don't call React hooks: - usePathFromParams → getPathFromParams - useExpansionPropHelpers → getExpansionPropHelpers - useFilterPropHelpers → getFilterPropHelpers - useSortPropHelpers → getSortPropHelpers - useBranding → getBranding - usePersistenceProvider → getPersistenceProvider Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Reviewer's GuideEnables the @eslint-react/no-unnecessary-use-prefix rule by renaming non-hook utility functions and helpers to drop the misleading File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
useBrandingmodule is still defined inhooks/useBranding.ts, but some imports were changed to@app/hooks/getBranding; either rename the file togetBranding.tsor keep importing from@app/hooks/useBrandingto avoid broken module resolution. - Since
useBrandingis now exported asgetBrandingby default, check for any remainingimport useBranding from "@app/hooks/useBranding"usages and update them for consistency with the new naming.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `useBranding` module is still defined in `hooks/useBranding.ts`, but some imports were changed to `@app/hooks/getBranding`; either rename the file to `getBranding.ts` or keep importing from `@app/hooks/useBranding` to avoid broken module resolution.
- Since `useBranding` is now exported as `getBranding` by default, check for any remaining `import useBranding from "@app/hooks/useBranding"` usages and update them for consistency with the new naming.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
The function was renamed to getBranding but the file is still useBranding.ts — keep import paths pointing to the file name. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…necessary-use-prefix
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1058 +/- ##
==========================================
- Coverage 50.68% 50.66% -0.02%
==========================================
Files 253 253
Lines 5499 5499
Branches 1660 1660
==========================================
- Hits 2787 2786 -1
- Misses 2440 2441 +1
Partials 272 272
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@eslint-react/no-unnecessary-use-prefixoverride from ESLint configuseprefix but don't call any React hooks:usePathFromParams→getPathFromParamsuseExpansionPropHelpers→getExpansionPropHelpersuseFilterPropHelpers→getFilterPropHelpersuseSortPropHelpers→getSortPropHelpersuseBranding→getBrandingusePersistenceProvider→getPersistenceProviderTest plan
npm run lintpasses with 0 warnings🤖 Generated with Claude Code
Summary by Sourcery
Enable the @eslint-react/no-unnecessary-use-prefix ESLint rule and align helper function naming with React hook conventions.
Enhancements:
Build: