-
Notifications
You must be signed in to change notification settings - Fork 0
Add React Doctor to GitHub Actions #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e71a0cf
ci: add React Doctor GitHub Actions workflow
AndersonDesign1 4cc262a
refactor: add PanelSection and MutationErrorBanner common components
AndersonDesign1 a3f36ec
refactor: clean up project-files-panel.tsx, use PanelSection and Muta…
AndersonDesign1 ab9617b
refactor: clean up project-milestones-panel.tsx, use PanelSection, Mu…
AndersonDesign1 891ac39
refactor: move optionalString helper to lib/utils.ts
AndersonDesign1 11966e0
refactor: clean up project-updates-panel.tsx to use PanelSection, Mut…
AndersonDesign1 68dddc2
refactor: add variant support to PanelSection component
AndersonDesign1 be2fc6f
refactor: update project-collaboration-panel.tsx to use PanelSection …
AndersonDesign1 1c89c3f
refactor: extract ChartCard helper in dashboard.tsx to reduce class d…
AndersonDesign1 f382a52
refactor: replace custom animate-bounce-short with standard animate-s…
AndersonDesign1 8ada609
perf: optimize getBudgetByClientData and getNextDeadline to use singl…
AndersonDesign1 2b5833b
refactor: apply codebase-wide Biome formatting and auto-fixes
AndersonDesign1 d96b893
fix(react): remove unused packages and resolve reduced-motion accessi…
AndersonDesign1 9f9f676
perf(react): hoist static arrays/objects to module scope and optimize…
AndersonDesign1 98b235d
fix(react): optimize charts rendering performance, resolve React 19 w…
AndersonDesign1 fcb714d
fix(react): refactor ChartTooltipContent to prevent rules-of-hooks vi…
AndersonDesign1 4edb761
fix(react): resolve remaining warnings in evil-brush, legend, and chart
AndersonDesign1 b74ec17
fix(react): resolve hydration, hooks, derived state, and lookup warni…
AndersonDesign1 1a157ab
Merge branch 'main' into react-doctor/add-github-actions
AndersonDesign1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # React Doctor — finds security, performance, correctness, accessibility, | ||
| # bundle-size, and architecture issues in React codebases. | ||
| # | ||
| # Docs: https://www.react.doctor/ci | ||
| # Source: https://github.com/millionco/react-doctor | ||
|
|
||
| name: React Doctor | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
| # Scans `main` on every push so you get a health-score trend on the | ||
| # default branch — useful for tracking the overall number commit-by-commit | ||
| # and catching regressions that slipped past PR review. PR-specific steps | ||
| # (the sticky summary comment) are skipped automatically on `push` events. | ||
| # Comment this block out if you only want PR-time scans. | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| # `actions/checkout` needs this to read the repo source. | ||
| contents: read | ||
| # Two uses: (1) reads the PR's changed-file list so the scan only checks | ||
| # what the PR touched (faster, scoped to the diff), and (2) posts/updates | ||
| # the sticky React Doctor summary comment on the PR. Downgrade `write` to | ||
| # `read` to keep the changed-file scan but disable comment posting. | ||
| pull-requests: write | ||
| # The sticky-comment step uses GitHub's `issues.createComment` / | ||
| # `issues.updateComment` endpoints — those are the same APIs that back PR | ||
| # comments (PRs are issues under the hood). Not exercised on `push` | ||
| # events, so safe to drop if you only run on `main`. | ||
| issues: write | ||
|
|
||
| # Cancels any in-flight scan for the same PR (or branch, on push) the moment | ||
| # a new commit arrives, so reviewers only ever see the latest run. | ||
| concurrency: | ||
| group: react-doctor-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| react-doctor: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: millionco/react-doctor@v1 | ||
| # Common configuration knobs — uncomment any to override the default. | ||
| # Full reference: https://www.react.doctor/ci | ||
| # with: | ||
| # non-blocking: true # Report findings but always exit 0 (won't fail the PR check) | ||
| # fail-on: warning # Gate level: "error" (default) | "warning" | "none" | ||
| # comment: false # Disable the sticky PR summary comment | ||
| # annotations: false # Disable inline GitHub Actions annotations on changed files | ||
| # version: "0.2.18" # Pin to a specific react-doctor version instead of "latest" | ||
| # directory: apps/web # Scan a sub-directory (default: ".") | ||
| # project: "web,admin" # In a monorepo, scan specific workspace project(s) | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "$schema": "https://react.doctor/schema/config.json", | ||
| "ignore": { | ||
| "files": [ | ||
| "src/components/ui/**", | ||
| "node_modules/**", | ||
| "drizzle/**", | ||
| "dist/**", | ||
| ".output/**", | ||
| "react-doctor-report.json" | ||
| ] | ||
| }, | ||
| "rules": { | ||
| "react-doctor/only-export-components": "off", | ||
| "react-doctor/no-giant-component": "off", | ||
| "react-doctor/no-multi-comp": "off", | ||
| "react-doctor/prefer-useReducer": "off", | ||
| "react-doctor/no-many-boolean-props": "off", | ||
| "react-doctor/prefer-dynamic-import": "off", | ||
| "react-doctor/no-event-handler": "off", | ||
| "react-doctor/control-has-associated-label": "off", | ||
| "react-doctor/use-lazy-motion": "off", | ||
| "react-doctor/jsx-no-jsx-as-prop": "off", | ||
| "deslop/unused-export": "off", | ||
| "deslop/unused-file": "off" | ||
| } | ||
| } |
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import type { ReactNode } from "react"; | ||
| import { cn } from "@/lib/utils"; | ||
|
|
||
| interface PanelSectionProps { | ||
| action?: ReactNode; | ||
| children: ReactNode; | ||
| className?: string; | ||
| description?: string; | ||
| title: string; | ||
| variant?: "card" | "ghost"; | ||
| } | ||
|
|
||
| export function PanelSection({ | ||
| title, | ||
| description, | ||
| action, | ||
| children, | ||
| className, | ||
| variant = "card", | ||
| }: PanelSectionProps) { | ||
| return ( | ||
| <section | ||
| className={cn( | ||
| "space-y-5", | ||
| variant === "card" && | ||
| "rounded-xl border border-border/40 bg-card p-6 shadow-[0_1px_3px_rgba(0,0,0,0.015)]", | ||
| className | ||
| )} | ||
| > | ||
| <div className="flex flex-wrap items-center justify-between gap-4 border-border/40 border-b pb-4"> | ||
| <div> | ||
| <h2 | ||
| className={cn( | ||
| "font-semibold text-foreground", | ||
| variant === "card" ? "text-lg" : "text-base" | ||
| )} | ||
| > | ||
| {title} | ||
| </h2> | ||
| {description && ( | ||
| <p | ||
| className={cn( | ||
| "mt-1 text-muted-foreground leading-relaxed", | ||
| variant === "card" ? "text-sm" : "text-xs" | ||
| )} | ||
| > | ||
| {description} | ||
| </p> | ||
| )} | ||
| </div> | ||
| {action} | ||
| </div> | ||
| {children} | ||
| </section> | ||
| ); | ||
| } |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both
actions/checkout@v5andmillionco/react-doctor@v1reference mutable version tags. If either upstream repo is compromised and the tag is force-pushed, the next workflow run silently executes attacker-controlled code — here withpull-requests: writeandissues: writein scope, enabling malicious PR comments, repository content reads, or issue tampering. GitHub's security guidance recommends pinning every action to a full 40-character commit SHA and keeping the version tag as a comment for readability, e.g.,uses: actions/checkout@<sha> # v5.Prompt To Fix With AI