chore(eslint): enable @eslint-react/rules-of-hooks rule#1053
Draft
carlosthe19916 wants to merge 4 commits into
Draft
chore(eslint): enable @eslint-react/rules-of-hooks rule#1053carlosthe19916 wants to merge 4 commits into
carlosthe19916 wants to merge 4 commits into
Conversation
- Rename usePathFromParams to getPathFromParams (not a hook) - Call useAuth() unconditionally in header.tsx - Suppress false positive for Playwright fixture use() in e2e Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnables the @eslint-react/rules-of-hooks rule by treating a routing helper as a plain utility instead of a React hook, fixing a conditional hook usage in the header, and adding a targeted lint suppression for a Playwright fixture, while removing the rule’s override from the ESLint config. Sequence diagram for HeaderApp useAuth hook usagesequenceDiagram
participant HeaderApp
participant useAuth
HeaderApp->>useAuth: useAuth()
useAuth-->>HeaderApp: authFromHook
HeaderApp->>HeaderApp: [isAuthRequired]
HeaderApp->>HeaderApp: auth = authFromHook
HeaderApp->>HeaderApp: [!isAuthRequired]
HeaderApp->>HeaderApp: auth = undefined
Flow diagram for getPathFromParams usage in route loadersflowchart TD
subgraph Routes
A[Params]
B[PathParam]
C[getPathFromParams]
end
subgraph Loaders
L1[advisory loader]
L2[package loader]
L3[sbom loader]
L4[vulnerability loader]
L5[sbomGroup loader]
end
A --> C
B --> C
C --> L1
C --> L2
C --> L3
C --> L4
C --> L5
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1053 +/- ##
==========================================
- Coverage 50.68% 50.67% -0.01%
==========================================
Files 253 253
Lines 5499 5500 +1
Branches 1660 1660
==========================================
Hits 2787 2787
- 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/rules-of-hooksoverride from ESLint configusePathFromParams→getPathFromParamssince it's a plain utility, not a React hookuseAuth()unconditionally inheader.tsx(was conditionally called via&&)use()fixture function in e2e testsTest plan
npm run lintpasses with 0 warnings🤖 Generated with Claude Code
Summary by Sourcery
Enable enforcement of React rules-of-hooks in ESLint and update code to comply with the rule.
Bug Fixes:
Enhancements:
Build: