Skip to content

Conversation

@sergiocarracedo
Copy link
Collaborator

@sergiocarracedo sergiocarracedo commented Jan 8, 2026

  • chore: lefthoox lint on commit
  • chore: bugbot

Description

Screenshots (if applicable)

[Link to Figma Design](Figma URL here)

Implementation details


Note

Introduces automated review guidance and improves developer workflow for the React package.

  • Adds packages/react/BUGBOT.md with comprehensive code review rules BugBot will enforce
  • Updates lefthook.yml pre-commit for React: format-react now calls package format on staged paths (repo-relative → package-relative) and adds lint-react to run lint:fix on staged files
  • Adjusts packages/react/package.json scripts: lint/lint:fix and format/format:check now accept optional path args (defaulting to src/**/* or src/), replacing hardcoded targets

Written by Cursor Bugbot for commit 133b11b. This will update automatically on new commits. Configure here.

@github-actions github-actions bot added the react Changes affect packages/react label Jan 8, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

✅ No New Circular Dependencies

No new circular dependencies detected. Current count: 0

@sergiocarracedo sergiocarracedo changed the title chore/bugbot chore: bugbot Jan 8, 2026
@github-actions github-actions bot added the chore label Jan 8, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

📦 Alpha Package Version Published

Use pnpm i github:factorialco/f0#npm/alpha-pr-3206 to install the package

Use pnpm i github:factorialco/f0#2604ebce30e4b55ce3e7f8f08ea95be56d3405ec to install this specific commit

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

🔍 Visual review for your branch is published 🔍

Here are the links to:

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

Coverage Report for packages/react

Status Category Percentage Covered / Total
🔵 Lines 37.46% 5772 / 15408
🔵 Statements 36.88% 5893 / 15976
🔵 Functions 26.55% 1224 / 4609
🔵 Branches 27.15% 3293 / 12127
File CoverageNo changed files found.
Generated in workflow #10118 for commit 133b11b by the Vitest Coverage Report Action

@sergiocarracedo sergiocarracedo marked this pull request as ready for review January 9, 2026 09:02
@sergiocarracedo sergiocarracedo requested a review from a team as a code owner January 9, 2026 09:02
Copilot AI review requested due to automatic review settings January 9, 2026 09:02
Copy link
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 introduces automated code review guidelines for the React package and enhances the pre-commit workflow to enforce formatting and linting standards.

  • Adds comprehensive code review guidelines in BUGBOT.md covering component structure, TypeScript standards, testing, styling, and Storybook requirements
  • Updates package.json scripts to accept optional file path arguments, enabling more flexible linting and formatting workflows
  • Configures lefthook to automatically format and lint staged React files on commit with path rewriting

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 12 comments.

File Description
packages/react/BUGBOT.md Adds detailed code review guidelines for React components, TypeScript, testing, styling, accessibility, and Storybook
packages/react/package.json Modifies lint and format scripts to accept optional file arguments using shell parameter expansion
lefthook.yml Updates format-react hook and adds lint-react hook with path transformation to strip package prefix

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

Comment on lines +34 to +35
"lint": "sh -c 'oxlint \"${@:-src/**/*}\" --max-warnings 0' --",
"lint:fix": "sh -c 'oxlint \"${@:-src/**/*}\" --fix --max-warnings 0' --",
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The shell parameter expansion ${@:-src/**/*} may not work correctly in all POSIX-compliant shells when invoked with sh -c. While this syntax works in bash, it's not standard POSIX. Consider using a more portable approach like: if [ $# -eq 0 ]; then set -- src/**/*; fi; oxlint "$@" --max-warnings 0 or explicitly use bash -c instead of sh -c.

Copilot uses AI. Check for mistakes.
Comment on lines +45 to +46
"format": "sh -c 'oxfmt \"${@:-src/}\"' --",
"format:check": "sh -c 'oxfmt --check \"${@:-src/}\"' --",
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The shell parameter expansion ${@:-src/} may not work correctly in all POSIX-compliant shells when invoked with sh -c. While this syntax works in bash, it's not standard POSIX. Consider using a more portable approach like: if [ $# -eq 0 ]; then set -- src/; fi; oxfmt "$@" or explicitly use bash -c instead of sh -c.

Copilot uses AI. Check for mistakes.
## Storybook
- Ensure the components have at leat one story file
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

Typo: "at leat" should be "at least"

Suggested change
- Ensure the components have at leat one story file
- Ensure the components have at least one story file

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice suggestion by Copilot. Please add it

- Ensure the components have at leat one story file
- Ensure the story docs covers all the properties
- For properties with with limited and well know options use the const array for the select values from the component. Avoid repeating the values in the story
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

Typo: "with with" should be "with"

Suggested change
- For properties with with limited and well know options use the const array for the select values from the component. Avoid repeating the values in the story
- For properties with limited and well know options use the const array for the select values from the component. Avoid repeating the values in the story

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice suggestion by Copilot. Please add it

### `src/ui/`
Ensure those components are no reexported
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

Grammatical error: "no reexported" should be "not re-exported"

Suggested change
Ensure those components are no reexported
Ensure those components are not re-exported

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice suggestion by Copilot. Please add it

- Ensure the components have at leat one story file
- Ensure the story docs covers all the properties
- For properties with with limited and well know options use the const array for the select values from the component. Avoid repeating the values in the story
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

Typo: "know" should be "known"

Suggested change
- For properties with with limited and well know options use the const array for the select values from the component. Avoid repeating the values in the story
- For properties with with limited and well known options use the const array for the select values from the component. Avoid repeating the values in the story

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice suggestion by Copilot. Please add it

}
```
- Ensure there is a story called Snapshot which includes `parameters: withSnapshot({}),` to ensure the component has visual regresions tests in chromatic
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

Typo: "regresions" should be "regressions"

Suggested change
- Ensure there is a story called Snapshot which includes `parameters: withSnapshot({}),` to ensure the component has visual regresions tests in chromatic
- Ensure there is a story called Snapshot which includes `parameters: withSnapshot({}),` to ensure the component has visual regression tests in chromatic

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice suggestion by Copilot. Please add it

- `hooks/` if the component has hook files (`useXXXX.ts`) should be in this folder
- `components/` if the component have internal subcomponents should be in this folder

Ensure elements `componentes/`, `internal-types` and `internal` files are not exported
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

Grammatical error: "Ensure elements componentes/, internal-types and internal files are not exported" is unclear. Consider revising to: "Ensure elements in components/, internal-types.ts, and internal files are not exported"

Suggested change
Ensure elements `componentes/`, `internal-types` and `internal` files are not exported
Ensure elements in `components/`, `internal-types.ts`, and `internal` files are not exported

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice suggestion by Copilot. Please add it


## Component Structure

- ban new components in `experimental` folder, they should be in `components` folder and use the experimentalComponent function from `@/lib/experimental.ts`
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The directive "ban new components in experimental folder" is unclear. Consider rephrasing to: "New components should not be added to the experimental folder; instead, add them to the components folder and use the experimentalComponent function from @/lib/experimental.ts"

Suggested change
- ban new components in `experimental` folder, they should be in `components` folder and use the experimentalComponent function from `@/lib/experimental.ts`
- New components should not be added to the `experimental` folder; instead, add them to the `components` folder and use the experimentalComponent function from `@/lib/experimental.ts`

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice suggestion by Copilot. Please add it

Copy link
Contributor

@developerdanx developerdanx left a comment

Choose a reason for hiding this comment

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

Thank you for bringing new improvements. Copilot left some nice comments and suggestions.


## Component Structure

- ban new components in `experimental` folder, they should be in `components` folder and use the experimentalComponent function from `@/lib/experimental.ts`
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice suggestion by Copilot. Please add it

- `hooks/` if the component has hook files (`useXXXX.ts`) should be in this folder
- `components/` if the component have internal subcomponents should be in this folder

Ensure elements `componentes/`, `internal-types` and `internal` files are not exported
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice suggestion by Copilot. Please add it

### `src/ui/`
Ensure those components are no reexported
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice suggestion by Copilot. Please add it

## Storybook
- Ensure the components have at leat one story file
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice suggestion by Copilot. Please add it

- Ensure the components have at leat one story file
- Ensure the story docs covers all the properties
- For properties with with limited and well know options use the const array for the select values from the component. Avoid repeating the values in the story
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice suggestion by Copilot. Please add it

- Ensure the components have at leat one story file
- Ensure the story docs covers all the properties
- For properties with with limited and well know options use the const array for the select values from the component. Avoid repeating the values in the story
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice suggestion by Copilot. Please add it

}
```
- Ensure there is a story called Snapshot which includes `parameters: withSnapshot({}),` to ensure the component has visual regresions tests in chromatic
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice suggestion by Copilot. Please add it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore react Changes affect packages/react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants