Skip to content

refactor: migrate eslint to v9 #5267

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

Merged
merged 7 commits into from
Jun 1, 2025
Merged

refactor: migrate eslint to v9 #5267

merged 7 commits into from
Jun 1, 2025

Conversation

wingkwong
Copy link
Member

@wingkwong wingkwong commented May 3, 2025

Closes #

📝 Description

⛳️ Current behavior (updates)

🚀 New behavior

💣 Is this a breaking change (Yes/No):

📝 Additional Information

Summary by CodeRabbit

  • Chores
    • Upgraded and modernized the linting and formatting toolchain, including major updates to ESLint, Prettier, and related plugins.
    • Migrated ESLint configuration to the new flat config format and updated ignore patterns.
    • Simplified and unified linting scripts.
    • Removed numerous inline ESLint disable comments across the codebase.
    • Removed legacy ESLint configuration and ignore files.
  • Style
    • Improved code readability by adjusting indentation, parentheses, and type assertion formatting in multiple files.
  • Bug Fixes
    • None.
  • New Features
    • None.

@wingkwong wingkwong added this to the v2.7.9 milestone May 3, 2025
@wingkwong wingkwong requested a review from jrgarciadev as a code owner May 3, 2025 05:54
Copy link

changeset-bot bot commented May 3, 2025

⚠️ No Changeset found

Latest commit: 281cf06

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented May 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
heroui ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2025 4:00am
heroui-sb ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2025 4:00am

Copy link
Contributor

coderabbitai bot commented May 3, 2025

Walkthrough

This update modernizes and refines the project's linting and formatting setup. The legacy .eslintrc.json and .eslintignore files were removed, replaced by a new eslint.config.mjs using the flat config format. ESLint-related scripts in package.json were consolidated, and all linting and formatting dependencies were upgraded to their latest versions. Numerous files across the codebase had inline ESLint directive comments removed, and minor formatting changes were applied for consistency, such as adjusting parentheses and indentation. Some catch blocks were simplified by omitting unused error parameters. No exported or public entity signatures were altered.

Changes

File(s) Change Summary
.eslintignore, .eslintrc.json Removed legacy ESLint ignore and config files.
eslint.config.mjs Added new ESLint flat config with global ignore patterns, modern plugins, and project-specific rules.
package.json Upgraded ESLint, Prettier, and related dependencies; consolidated lint scripts.
.lintstagedrc.cjs Updated ESLint command to remove explicit config file reference.
apps/docs/components/ads/carbon-ad/carbon-ad.tsx, apps/docs/components/marketing/support.tsx, apps/docs/libs/github/utils.ts, apps/docs/scripts/build-sponsors.ts, apps/docs/scripts/update-search-meta.ts, apps/docs/utils/get-sponsors.ts, packages/utilities/react-utils/src/refs.ts, packages/utilities/shared-utils/scripts/postinstall.js, packages/utilities/shared-utils/src/common/functions.ts, packages/components/tooltip/src/tooltip.tsx Simplified catch blocks by removing unused error parameters.
apps/docs/app/examples/autocomplete/async-filtering/page.tsx, apps/docs/app/examples/table/custom-styles/page.tsx, apps/docs/app/examples/table/use-case/page.tsx, apps/docs/components/blog/video-in-view.tsx, apps/docs/components/marketing/a11y-otb.tsx, apps/docs/components/marketing/custom-themes/custom-themes.tsx, apps/docs/components/marketing/customization.tsx, apps/docs/components/marketing/dark-mode.tsx, apps/docs/components/marketing/last-but-not-least.tsx, apps/docs/components/mdx-components.tsx, apps/docs/hooks/use-scroll-position.ts, apps/docs/hooks/use-scroll-spy.ts, apps/docs/hooks/use-update-effect.ts, apps/docs/components/docs/components/code-demo/code-demo.tsx, apps/docs/components/ads/carbon-ad/carbon-optimize.js, apps/docs/libs/rehype-highlight-line.js, packages/components/avatar/stories/avatar-group.stories.tsx, packages/components/calendar/__tests__/calendar.test.tsx, packages/components/card/stories/card.stories.tsx, packages/components/checkbox/stories/checkbox.stories.tsx, packages/components/input-otp/stories/input-otp.stories.tsx, packages/components/modal/stories/modal.stories.tsx, packages/components/number-input/stories/number-input.stories.tsx, packages/components/select/stories/select.stories.tsx, packages/components/slider/stories/slider.stories.tsx, packages/components/switch/stories/switch.stories.tsx, packages/utilities/shared-utils/src/common/clsx.ts, packages/hooks/use-callback-ref/src/index.ts, packages/hooks/use-intersection-observer/src/index.ts, packages/hooks/use-update-effect/src/index.ts Removed ESLint directive comments disabling specific rules.
packages/components/autocomplete/src/use-autocomplete.ts, packages/components/checkbox/src/use-checkbox.ts, packages/components/select/src/hidden-select.tsx, packages/components/select/src/use-select.ts, packages/components/snippet/src/use-snippet.ts, packages/components/pagination/__tests__/pagination.test.tsx, packages/components/pagination/src/pagination.tsx, packages/components/slider/src/use-slider.ts, packages/core/system-rsc/src/extend-variants.d.ts, packages/utilities/react-utils/src/dimensions.ts, packages/utilities/test-utils/src/dom.ts, packages/utilities/test-utils/src/drag.ts Adjusted parentheses, indentation, or type assertion formatting for clarity and consistency; no logic changes.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant ESLint
    participant Project Files

    Developer->>ESLint: Run lint (via script or pre-commit)
    ESLint->>eslint.config.mjs: Load flat config and ignore patterns
    ESLint->>Project Files: Lint all JS/TS files (excluding ignored patterns)
    Project Files-->>ESLint: Provide source code
    ESLint-->>Developer: Report issues, auto-fix where possible
Loading

Suggested reviewers

  • jrgarciadev
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🔭 Outside diff range comments (1)
packages/components/autocomplete/src/use-autocomplete.ts (1)

147-154: ⚠️ Potential issue

isClearable may become undefined; coerce to boolean

When isReadOnly is false and originalProps.isClearable is omitted, isClearable will be undefined, yet downstream styling and logic treat it as a boolean.

-      : originalProps.isReadOnly
-        ? false
-        : originalProps.isClearable;
+      : originalProps.isReadOnly
+        ? false
+        : Boolean(originalProps.isClearable);

This prevents accidental truthy/falsey coercion bugs later.

🧹 Nitpick comments (3)
packages/components/checkbox/src/use-checkbox.ts (1)

326-334: Cast placement is safer, but consider satisfies for future-proofing

Moving the as CheckboxIconProps cast outside the object avoids partial-typed literals and works today; however, once you move to TS 5.0+ you could drop the cast completely with

return {
  /* … */
} satisfies CheckboxIconProps;

to retain literal inference while still type-checking.

packages/components/autocomplete/src/use-autocomplete.ts (2)

398-407: Nit: type assertion can be dropped once generics propagate

The cast to ButtonProps is only needed because the return literal isn’t generic-aware. If you ever lift this helper out, consider giving getSelectorButtonProps its own return type so the assertion can be removed.


438-451: Same observation for InputProps

Casting the object to InputProps is fine, but a dedicated type/generic would avoid the unknown as dance.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2cbc689 and c50fb40.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (58)
  • .eslintignore (0 hunks)
  • .eslintrc.json (0 hunks)
  • .lintstagedrc.cjs (1 hunks)
  • apps/docs/app/examples/autocomplete/async-filtering/page.tsx (0 hunks)
  • apps/docs/app/examples/table/custom-styles/page.tsx (0 hunks)
  • apps/docs/app/examples/table/use-case/page.tsx (0 hunks)
  • apps/docs/components/ads/carbon-ad/carbon-ad.tsx (1 hunks)
  • apps/docs/components/ads/carbon-ad/carbon-optimize.js (0 hunks)
  • apps/docs/components/blog/video-in-view.tsx (0 hunks)
  • apps/docs/components/cmdk.tsx (1 hunks)
  • apps/docs/components/docs/components/code-demo/code-demo.tsx (1 hunks)
  • apps/docs/components/marketing/a11y-otb.tsx (0 hunks)
  • apps/docs/components/marketing/custom-themes/custom-themes.tsx (0 hunks)
  • apps/docs/components/marketing/customization.tsx (0 hunks)
  • apps/docs/components/marketing/dark-mode.tsx (0 hunks)
  • apps/docs/components/marketing/last-but-not-least.tsx (0 hunks)
  • apps/docs/components/marketing/support.tsx (1 hunks)
  • apps/docs/components/mdx-components.tsx (0 hunks)
  • apps/docs/hooks/use-scroll-position.ts (0 hunks)
  • apps/docs/hooks/use-scroll-spy.ts (0 hunks)
  • apps/docs/hooks/use-update-effect.ts (0 hunks)
  • apps/docs/libs/github/utils.ts (1 hunks)
  • apps/docs/libs/rehype-highlight-line.js (0 hunks)
  • apps/docs/scripts/build-sponsors.ts (1 hunks)
  • apps/docs/scripts/update-search-meta.ts (1 hunks)
  • apps/docs/utils/get-sponsors.ts (1 hunks)
  • eslint.config.mjs (1 hunks)
  • package.json (4 hunks)
  • packages/components/autocomplete/src/use-autocomplete.ts (4 hunks)
  • packages/components/avatar/stories/avatar-group.stories.tsx (0 hunks)
  • packages/components/calendar/__tests__/calendar.test.tsx (0 hunks)
  • packages/components/card/stories/card.stories.tsx (0 hunks)
  • packages/components/checkbox/src/use-checkbox.ts (2 hunks)
  • packages/components/checkbox/stories/checkbox.stories.tsx (1 hunks)
  • packages/components/input-otp/stories/input-otp.stories.tsx (0 hunks)
  • packages/components/modal/stories/modal.stories.tsx (0 hunks)
  • packages/components/number-input/stories/number-input.stories.tsx (0 hunks)
  • packages/components/pagination/__tests__/pagination.test.tsx (1 hunks)
  • packages/components/pagination/src/pagination.tsx (1 hunks)
  • packages/components/select/src/hidden-select.tsx (1 hunks)
  • packages/components/select/src/use-select.ts (1 hunks)
  • packages/components/select/stories/select.stories.tsx (0 hunks)
  • packages/components/slider/src/use-slider.ts (1 hunks)
  • packages/components/slider/stories/slider.stories.tsx (0 hunks)
  • packages/components/snippet/src/use-snippet.ts (1 hunks)
  • packages/components/switch/stories/switch.stories.tsx (0 hunks)
  • packages/components/tooltip/src/tooltip.tsx (1 hunks)
  • packages/core/system-rsc/src/extend-variants.d.ts (1 hunks)
  • packages/hooks/use-callback-ref/src/index.ts (0 hunks)
  • packages/hooks/use-intersection-observer/src/index.ts (1 hunks)
  • packages/hooks/use-update-effect/src/index.ts (0 hunks)
  • packages/utilities/react-utils/src/dimensions.ts (1 hunks)
  • packages/utilities/react-utils/src/refs.ts (1 hunks)
  • packages/utilities/shared-utils/scripts/postinstall.js (1 hunks)
  • packages/utilities/shared-utils/src/common/clsx.ts (0 hunks)
  • packages/utilities/shared-utils/src/common/functions.ts (1 hunks)
  • packages/utilities/test-utils/src/dom.ts (1 hunks)
  • packages/utilities/test-utils/src/drag.ts (1 hunks)
💤 Files with no reviewable changes (29)
  • apps/docs/components/marketing/customization.tsx
  • apps/docs/hooks/use-scroll-position.ts
  • apps/docs/components/blog/video-in-view.tsx
  • apps/docs/app/examples/autocomplete/async-filtering/page.tsx
  • apps/docs/components/marketing/last-but-not-least.tsx
  • packages/utilities/shared-utils/src/common/clsx.ts
  • packages/components/slider/stories/slider.stories.tsx
  • packages/components/modal/stories/modal.stories.tsx
  • apps/docs/components/mdx-components.tsx
  • apps/docs/hooks/use-scroll-spy.ts
  • apps/docs/components/marketing/dark-mode.tsx
  • packages/components/switch/stories/switch.stories.tsx
  • packages/components/number-input/stories/number-input.stories.tsx
  • apps/docs/components/marketing/custom-themes/custom-themes.tsx
  • packages/hooks/use-update-effect/src/index.ts
  • packages/hooks/use-callback-ref/src/index.ts
  • packages/components/avatar/stories/avatar-group.stories.tsx
  • packages/components/calendar/tests/calendar.test.tsx
  • apps/docs/components/marketing/a11y-otb.tsx
  • packages/components/select/stories/select.stories.tsx
  • apps/docs/libs/rehype-highlight-line.js
  • apps/docs/app/examples/table/use-case/page.tsx
  • packages/components/input-otp/stories/input-otp.stories.tsx
  • apps/docs/hooks/use-update-effect.ts
  • packages/components/card/stories/card.stories.tsx
  • apps/docs/app/examples/table/custom-styles/page.tsx
  • apps/docs/components/ads/carbon-ad/carbon-optimize.js
  • .eslintrc.json
  • .eslintignore
🧰 Additional context used
🧬 Code Graph Analysis (3)
apps/docs/components/cmdk.tsx (1)
packages/utilities/shared-utils/src/common/assertion.ts (1)
  • isEmpty (26-32)
packages/components/autocomplete/src/use-autocomplete.ts (2)
packages/components/button/src/button.tsx (1)
  • ButtonProps (7-7)
packages/components/input/src/input.tsx (1)
  • InputProps (7-7)
packages/components/select/src/use-select.ts (1)
packages/components/select/src/hidden-select.tsx (1)
  • HiddenSelectProps (35-44)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: TypeScript
  • GitHub Check: Tests
  • GitHub Check: Build
  • GitHub Check: Continuous Release
🔇 Additional comments (28)
apps/docs/components/docs/components/code-demo/code-demo.tsx (2)

22-23: ESLint disable comment removed

The ESLint disable comment for react/display-name has been removed as part of the ESLint v9 migration. This suggests that either the rule has been configured differently in the new flat config or the issue is no longer relevant with the updated linting rules.


29-30: ESLint disable comment removed

Similar to the previous instance, the ESLint disable comment for react/display-name has been removed from the dynamic import of DynamicSandpack. This is consistent with the ESLint v9 migration approach throughout the codebase.

packages/utilities/shared-utils/scripts/postinstall.js (1)

7-7: Unused error parameter removed

The catch clause has been simplified by removing the unused error parameter e. This is good practice as it avoids declaring variables that aren't used, which helps satisfy linting rules that warn about unused variables.

packages/utilities/test-utils/src/dom.ts (1)

18-18: Improved expression clarity with parentheses

Parentheses have been added around the nullish coalescing expression (node.ownerDocument ?? document) in the ternary operator. This enhances readability by explicitly grouping the expression without changing the functionality.

packages/utilities/shared-utils/src/common/functions.ts (1)

156-156: Unused error parameter removed

The catch clause has been simplified by removing the unused error parameter. This is a good practice that aligns with modern JavaScript conventions to avoid declaring variables that aren't used in the code block.

apps/docs/libs/github/utils.ts (1)

10-10: Good cleanup: Removed unused error parameter.

The change removes an unused error parameter from the catch clause, resulting in cleaner and more concise code since the error object isn't used in the catch block.

packages/components/checkbox/stories/checkbox.stories.tsx (1)

257-258: LGTM: Removed unnecessary ESLint directive comment.

This change removes an ESLint directive comment that was previously disabling the react/display-name rule. With ESLint v9's configuration, this directive is no longer needed, which helps maintain cleaner code without excessive comments.

apps/docs/scripts/build-sponsors.ts (1)

51-51: Good cleanup: Removed unused error parameter.

Similar to other changes in this PR, this removes an unused error parameter from the catch clause, improving code clarity. The catch block only needs to handle the exception without accessing the error details.

apps/docs/components/cmdk.tsx (1)

213-213: Improved code clarity with explicit parentheses.

Adding parentheses around the fallback expression (recentSearches ?? []) enhances readability by making the operator precedence explicit. This is a good style improvement without changing the functionality.

packages/hooks/use-intersection-observer/src/index.ts (1)

96-96: Linting rule enforcement improvement

The removal of the ESLint disable comment for react-hooks/exhaustive-deps is a good change that enforces better dependency tracking in the useEffect hook. This aligns with the PR's objective of migrating to ESLint v9 and standardizing linting behavior.

packages/utilities/react-utils/src/dimensions.ts (1)

11-12: Improved code readability

The adjusted indentation of the nested ternary expressions improves code readability by properly aligning the conditional branches. This makes the logic flow clearer and easier to follow.

packages/utilities/react-utils/src/refs.ts (1)

24-24: Simplified error handling

Good simplification of the catch block by removing the unused error parameter while maintaining the same error handling behavior. This change aligns with modern JavaScript best practices for cleaner code.

packages/core/system-rsc/src/extend-variants.d.ts (1)

31-34: Enhanced type definition readability

The improved indentation in the complex type definition makes the nested structure clearer. This formatting change makes the conditional type relationships more visible and easier to understand for developers working with this code.

apps/docs/components/ads/carbon-ad/carbon-ad.tsx (1)

94-96: Clean error handling improvement.

Good change removing the unused error parameter from the catch block, making the code cleaner while maintaining the same fallback behavior.

packages/components/snippet/src/use-snippet.ts (1)

245-245: Consistent type assertion formatting.

Good change standardizing the TypeScript type assertion placement, which aligns with modern style conventions without changing functionality.

packages/components/slider/src/use-slider.ts (1)

255-256: Improved code readability.

Good formatting change that enhances the readability of the nested ternary expression by using proper indentation, making the code structure clearer.

apps/docs/components/marketing/support.tsx (1)

12-14: Clean error handling improvement.

Good change removing the unused error parameter from the catch block, making the code cleaner while maintaining the same error handling behavior.

packages/components/pagination/__tests__/pagination.test.tsx (1)

97-98: Improved nested ternary readability

The indentation of the nested ternary expression has been improved, making the code easier to read and understand. This change follows good formatting practices for nested conditionals.

apps/docs/utils/get-sponsors.ts (1)

23-23: Simplified catch clause

Removing the unused error parameter in the catch clause makes the code cleaner while maintaining the same functionality. This is in line with modern JavaScript practices for handling unused parameters.

.lintstagedrc.cjs (1)

19-19:

✅ Verification successful

Updated ESLint configuration approach

The explicit reference to .eslintrc.json has been removed from the ESLint command, allowing ESLint to automatically use the new flat config format. This aligns with the migration to ESLint v9.


🏁 Script executed:

#!/bin/bash
# Check if eslint.config.mjs exists in the project
find . -maxdepth 1 -name "eslint.config.mjs" -type f
# Check if the old .eslintrc.json still exists
find . -maxdepth 1 -name ".eslintrc.json" -type f

Length of output: 122


Confirm usage of new flat ESLint config

The project root now contains eslint.config.mjs and no longer has .eslintrc.json, so removing the explicit config reference in the lint-staged command is correct. The command in .lintstagedrc.cjs (line 19) can safely rely on ESLint v9’s flat config resolution.

apps/docs/scripts/update-search-meta.ts (1)

104-104: Simplified empty catch clause

The unused error parameter has been removed from the catch block, making the code more concise while maintaining the same error handling behavior. This pattern is consistently applied across the codebase as part of the ESLint modernization effort.

packages/components/pagination/src/pagination.tsx (1)

126-127: Improved code indentation for clarity.

The indentation of the nested ternary expression is now properly aligned, making the code more readable and consistent with the project's formatting standards.

packages/components/select/src/hidden-select.tsx (1)

107-107: Enhanced expression clarity with parentheses.

Adding parentheses around the fallback expression ([...state.selectedKeys][0] ?? "") improves code readability by explicitly grouping the operations, making the intent clearer.

packages/components/select/src/use-select.ts (1)

498-498: Improved TypeScript type assertion style.

The type assertion has been moved outside the returned object literal, which follows a more consistent and modern TypeScript pattern. This change aligns with the code style improvements being made throughout the codebase as part of the ESLint migration.

packages/components/tooltip/src/tooltip.tsx (1)

57-57: Simplified catch block by removing unused parameter.

Removing the unused error parameter from the catch block follows clean code practices and reduces unnecessary variables, while maintaining the same functionality.

packages/utilities/test-utils/src/drag.ts (1)

78-79: Formatting-only change looks good

Indentation of the nested ternary now matches the project style and improves readability without altering behaviour.

packages/components/checkbox/src/use-checkbox.ts (1)

100-107: Precedence clarified, LGTM

Wrapping the fallback of isInvalidProp and validationBehavior in parentheses removes any ambiguity in the ternary evaluation order. Good defensive coding.

package.json (1)

65-106: Verify plugin compatibility with ESLint 9

You’ve bumped eslint to ^9.26.0, but many ecosystem plugins haven’t reached full v9 support. If any plugin still declares a peer-dep of <9, installs will warn or break.

Please run a quick peer-dependency audit (npm ls --depth=1 | grep eslint) or similar before merging.

Copy link

pkg-pr-new bot commented May 3, 2025

Open in StackBlitz

@heroui/accordion

npm i https://pkg.pr.new/@heroui/accordion@5267

@heroui/autocomplete

npm i https://pkg.pr.new/@heroui/autocomplete@5267

@heroui/alert

npm i https://pkg.pr.new/@heroui/alert@5267

@heroui/avatar

npm i https://pkg.pr.new/@heroui/avatar@5267

@heroui/badge

npm i https://pkg.pr.new/@heroui/badge@5267

@heroui/breadcrumbs

npm i https://pkg.pr.new/@heroui/breadcrumbs@5267

@heroui/button

npm i https://pkg.pr.new/@heroui/button@5267

@heroui/calendar

npm i https://pkg.pr.new/@heroui/calendar@5267

@heroui/card

npm i https://pkg.pr.new/@heroui/card@5267

@heroui/checkbox

npm i https://pkg.pr.new/@heroui/checkbox@5267

@heroui/chip

npm i https://pkg.pr.new/@heroui/chip@5267

@heroui/code

npm i https://pkg.pr.new/@heroui/code@5267

@heroui/date-input

npm i https://pkg.pr.new/@heroui/date-input@5267

@heroui/date-picker

npm i https://pkg.pr.new/@heroui/date-picker@5267

@heroui/divider

npm i https://pkg.pr.new/@heroui/divider@5267

@heroui/drawer

npm i https://pkg.pr.new/@heroui/drawer@5267

@heroui/dropdown

npm i https://pkg.pr.new/@heroui/dropdown@5267

@heroui/form

npm i https://pkg.pr.new/@heroui/form@5267

@heroui/image

npm i https://pkg.pr.new/@heroui/image@5267

@heroui/input

npm i https://pkg.pr.new/@heroui/input@5267

@heroui/input-otp

npm i https://pkg.pr.new/@heroui/input-otp@5267

@heroui/kbd

npm i https://pkg.pr.new/@heroui/kbd@5267

@heroui/listbox

npm i https://pkg.pr.new/@heroui/listbox@5267

@heroui/link

npm i https://pkg.pr.new/@heroui/link@5267

@heroui/menu

npm i https://pkg.pr.new/@heroui/menu@5267

@heroui/modal

npm i https://pkg.pr.new/@heroui/modal@5267

@heroui/navbar

npm i https://pkg.pr.new/@heroui/navbar@5267

@heroui/number-input

npm i https://pkg.pr.new/@heroui/number-input@5267

@heroui/pagination

npm i https://pkg.pr.new/@heroui/pagination@5267

@heroui/popover

npm i https://pkg.pr.new/@heroui/popover@5267

@heroui/progress

npm i https://pkg.pr.new/@heroui/progress@5267

@heroui/radio

npm i https://pkg.pr.new/@heroui/radio@5267

@heroui/ripple

npm i https://pkg.pr.new/@heroui/ripple@5267

@heroui/scroll-shadow

npm i https://pkg.pr.new/@heroui/scroll-shadow@5267

@heroui/select

npm i https://pkg.pr.new/@heroui/select@5267

@heroui/skeleton

npm i https://pkg.pr.new/@heroui/skeleton@5267

@heroui/slider

npm i https://pkg.pr.new/@heroui/slider@5267

@heroui/snippet

npm i https://pkg.pr.new/@heroui/snippet@5267

@heroui/spacer

npm i https://pkg.pr.new/@heroui/spacer@5267

@heroui/spinner

npm i https://pkg.pr.new/@heroui/spinner@5267

@heroui/switch

npm i https://pkg.pr.new/@heroui/switch@5267

@heroui/table

npm i https://pkg.pr.new/@heroui/table@5267

@heroui/tabs

npm i https://pkg.pr.new/@heroui/tabs@5267

@heroui/toast

npm i https://pkg.pr.new/@heroui/toast@5267

@heroui/tooltip

npm i https://pkg.pr.new/@heroui/tooltip@5267

@heroui/user

npm i https://pkg.pr.new/@heroui/user@5267

@heroui/react

npm i https://pkg.pr.new/@heroui/react@5267

@heroui/system

npm i https://pkg.pr.new/@heroui/system@5267

@heroui/system-rsc

npm i https://pkg.pr.new/@heroui/system-rsc@5267

@heroui/theme

npm i https://pkg.pr.new/@heroui/theme@5267

@heroui/use-aria-accordion

npm i https://pkg.pr.new/@heroui/use-aria-accordion@5267

@heroui/use-aria-accordion-item

npm i https://pkg.pr.new/@heroui/use-aria-accordion-item@5267

@heroui/use-aria-button

npm i https://pkg.pr.new/@heroui/use-aria-button@5267

@heroui/use-aria-link

npm i https://pkg.pr.new/@heroui/use-aria-link@5267

@heroui/use-aria-modal-overlay

npm i https://pkg.pr.new/@heroui/use-aria-modal-overlay@5267

@heroui/use-aria-multiselect

npm i https://pkg.pr.new/@heroui/use-aria-multiselect@5267

@heroui/use-callback-ref

npm i https://pkg.pr.new/@heroui/use-callback-ref@5267

@heroui/use-clipboard

npm i https://pkg.pr.new/@heroui/use-clipboard@5267

@heroui/use-data-scroll-overflow

npm i https://pkg.pr.new/@heroui/use-data-scroll-overflow@5267

@heroui/use-disclosure

npm i https://pkg.pr.new/@heroui/use-disclosure@5267

@heroui/use-draggable

npm i https://pkg.pr.new/@heroui/use-draggable@5267

@heroui/use-image

npm i https://pkg.pr.new/@heroui/use-image@5267

@heroui/use-infinite-scroll

npm i https://pkg.pr.new/@heroui/use-infinite-scroll@5267

@heroui/use-intersection-observer

npm i https://pkg.pr.new/@heroui/use-intersection-observer@5267

@heroui/use-is-mobile

npm i https://pkg.pr.new/@heroui/use-is-mobile@5267

@heroui/use-is-mounted

npm i https://pkg.pr.new/@heroui/use-is-mounted@5267

@heroui/use-measure

npm i https://pkg.pr.new/@heroui/use-measure@5267

@heroui/use-real-shape

npm i https://pkg.pr.new/@heroui/use-real-shape@5267

@heroui/use-pagination

npm i https://pkg.pr.new/@heroui/use-pagination@5267

@heroui/use-ref-state

npm i https://pkg.pr.new/@heroui/use-ref-state@5267

@heroui/use-resize

npm i https://pkg.pr.new/@heroui/use-resize@5267

@heroui/use-safe-layout-effect

npm i https://pkg.pr.new/@heroui/use-safe-layout-effect@5267

@heroui/use-scroll-position

npm i https://pkg.pr.new/@heroui/use-scroll-position@5267

@heroui/use-ssr

npm i https://pkg.pr.new/@heroui/use-ssr@5267

@heroui/use-theme

npm i https://pkg.pr.new/@heroui/use-theme@5267

@heroui/use-update-effect

npm i https://pkg.pr.new/@heroui/use-update-effect@5267

@heroui/aria-utils

npm i https://pkg.pr.new/@heroui/aria-utils@5267

@heroui/dom-animation

npm i https://pkg.pr.new/@heroui/dom-animation@5267

@heroui/framer-utils

npm i https://pkg.pr.new/@heroui/framer-utils@5267

@heroui/react-rsc-utils

npm i https://pkg.pr.new/@heroui/react-rsc-utils@5267

@heroui/react-utils

npm i https://pkg.pr.new/@heroui/react-utils@5267

@heroui/shared-icons

npm i https://pkg.pr.new/@heroui/shared-icons@5267

@heroui/shared-utils

npm i https://pkg.pr.new/@heroui/shared-utils@5267

@heroui/stories-utils

npm i https://pkg.pr.new/@heroui/stories-utils@5267

@heroui/test-utils

npm i https://pkg.pr.new/@heroui/test-utils@5267

commit: 281cf06

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (3)
eslint.config.mjs (3)

52-57: ⚠️ Potential issue

Missing react-hooks plugin import

You're extending "plugin:react-hooks/recommended" but haven't imported the react-hooks plugin.

Add the import and plugin entry:

-import react from "eslint-plugin-react";
+import react from "eslint-plugin-react";
+import reactHooks from "eslint-plugin-react-hooks";

 ...

 plugins: {
   react: fixupPluginRules(react),
+  "react-hooks": reactHooks,
   "unused-imports": unusedImports,

Without this, ESLint will throw an error when loading the config.


59-66: ⚠️ Potential issue

Add react-hooks to plugins configuration

The plugin section needs to include the react-hooks plugin to match the extended configuration.

 plugins: {
     react: fixupPluginRules(react),
+    "react-hooks": reactHooks,
     "unused-imports": unusedImports,
     import: fixupPluginRules(_import),
     "@typescript-eslint": typescriptEslint,
     "jsx-a11y": fixupPluginRules(jsxA11Y),
     prettier: fixupPluginRules(prettier),
 },

95-104: 🛠️ Refactor suggestion

Re-enable react-hooks/exhaustive-deps rule

Disabling this rule hides a whole class of stale-closure bugs. With the plugin now present, you should enable it.

-"react-hooks/exhaustive-deps": "off",
+"react-hooks/exhaustive-deps": "warn",

Consider stricter settings ("error") once the codebase is clean.

🧹 Nitpick comments (1)
eslint.config.mjs (1)

68-73: Consider reviewing global variables configuration

The approach of disabling all browser globals might be too restrictive. Consider enabling specific browser globals that might be needed for your application.

 globals: {
-    ...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, "off"])),
+    // Selectively enable browser globals that are needed
+    window: "readonly",
+    document: "readonly",
+    fetch: "readonly",
     ...globals.node,
 },
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c50fb40 and 281cf06.

📒 Files selected for processing (3)
  • apps/docs/scripts/update-github-info.ts (1 hunks)
  • eslint.config.mjs (1 hunks)
  • package.json (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: TypeScript
  • GitHub Check: Tests
  • GitHub Check: Continuous Release
  • GitHub Check: Build
  • GitHub Check: Prettier
🔇 Additional comments (7)
apps/docs/scripts/update-github-info.ts (1)

38-38: Good improvement: Added proper async handling for prettier.format

The addition of await correctly handles the asynchronous nature of prettier.format(). This ensures that the JSON formatting operation completes before the formatted content is written to the file.

eslint.config.mjs (6)

1-15: LGTM: Good plugin imports and configuration setup

The imports are comprehensive and well-structured, including all necessary plugins for TypeScript, React, accessibility, and code style enforcement.


24-51: Comprehensive ignore patterns implemented

The global ignore patterns effectively replace the previous .eslintignore file, providing comprehensive coverage of build artifacts, dependency folders, and configuration files.


104-113: Good unused variable handling configuration

The configuration properly disables core ESLint and unused-imports unused variable rules in favor of the TypeScript-specific version, with appropriate patterns for argument handling.


114-133: Well-structured import ordering rules

The import ordering configuration is comprehensive with appropriate grouping and newline requirements. The inclusion of path patterns for internal modules is a good practice.


135-142: Good JSX formatting rules

The self-closing component and JSX prop sorting rules promote consistency and readability in React components.


144-159: Comprehensive code style and formatting rules

The padding line between statements and type import style rules promote consistent and readable code.

@jrgarciadev jrgarciadev merged commit 8c26137 into canary Jun 1, 2025
10 checks passed
@jrgarciadev jrgarciadev deleted the refactor/eslint-v9 branch June 1, 2025 16:51
jrgarciadev added a commit that referenced this pull request Jun 1, 2025
* fix(date-picker): error state (#5317)

* fix(date-range-picker): fixed the error state in preset

* Update giant-sloths-shop.md

* Removed if statement

* chore(date-picker): prettier

---------

Co-authored-by: WK Wong <[email protected]>

* fix(theme): clear button in mobile (#5252)

* fix(toast): fixed close button hover position

* fix(input): fixed the clear button rendering on smaller devices

* Delete .changeset/soft-spoons-march.md

* Update input.ts

* Undo unrelated toast changes

* fix(toast): icons (#5246)

* feat(shared-icons): add loading icon

* fix(toast): icons

* chore(toast): revise types for icons

* chore(changeset): add changeset

* refactor: migrate eslint to v9 (#5267)

* refactor: migrate eslint to v9

* chore: lint

* chore: update eslint command

* chore: fix lint warnings

* chore: separate lint and lint:fix

* chore: exclude contentlayer generated code

* fix(scripts): add missing await

* fix(autocomplete): persist last selected item position (#5286)

* refactor(select): remove unnecessary code

* fix(autocomplete): persist last selected item position

* chore(changeset): add changeset

* chore(deps): bump framer-motion version (#5287)

* chore(deps): bump framer-motion version

* fix: typing issues

* chore(changeset): add changeset

---------

Co-authored-by: Junior Garcia <[email protected]>

* chore(docs): supplement onAction & selectionBehavior (#5289)

* fix(autocomplete): ensure focused item matches selected item after filter, selection (#5290)

* fix(autocomplete): ensure focused item matches selected item after filter, selection

* chore: apply type and default value

* chore: add perpose coment in updated code

* test: add focuskey management testcode

* docs: add changeset

* docs: update changeset

* chore: remove comment

* fix: broken components in stories (#5291)

* chore(switch): remove xl size

* chore(docs): remove xl size

* chore(system-rsc): remove xl size

* chore(circular-progress): remove xl size

* chore: undo

* chore(deps): bump RA versions (#5310)

* chore(deps): ra version bump

* chore(changeset): add changeset

* fix(scripts): incorrect docs path

---------

Co-authored-by: Junior Garcia <[email protected]>

* chore(docs): update meta data (#5311)

* docs(layout.tsx): added text-foreground (#5316)

* feat(tabs): add click handling for tab items in tests and implementation (#3917)

Co-authored-by: WK Wong <[email protected]>

* fix issues in tabs examples (#2405)

Co-authored-by: WK Wong <[email protected]>

* chore(docs): add missing onValueChange in CheckboxGroup (#5332)

* ci(changesets): version packages (#5323)

Co-authored-by: Junior Garcia <[email protected]>

---------

Co-authored-by: Vishv Salvi <[email protected]>
Co-authored-by: WK Wong <[email protected]>
Co-authored-by: KumJungMin <[email protected]>
Co-authored-by: liaoyinglong <[email protected]>
Co-authored-by: zhengjitf <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
wingkwong added a commit that referenced this pull request Jun 2, 2025
* chore: add herohack announcement

* fix(date-picker): error state (#5317)

* fix(date-range-picker): fixed the error state in preset

* Update giant-sloths-shop.md

* Removed if statement

* chore(date-picker): prettier

---------

Co-authored-by: WK Wong <[email protected]>

* chore: banner replacement

* fix(theme): clear button in mobile (#5252)

* fix(toast): fixed close button hover position

* fix(input): fixed the clear button rendering on smaller devices

* Delete .changeset/soft-spoons-march.md

* Update input.ts

* Undo unrelated toast changes

* fix(toast): icons (#5246)

* feat(shared-icons): add loading icon

* fix(toast): icons

* chore(toast): revise types for icons

* chore(changeset): add changeset

* refactor: migrate eslint to v9 (#5267)

* refactor: migrate eslint to v9

* chore: lint

* chore: update eslint command

* chore: fix lint warnings

* chore: separate lint and lint:fix

* chore: exclude contentlayer generated code

* fix(scripts): add missing await

* fix(autocomplete): persist last selected item position (#5286)

* refactor(select): remove unnecessary code

* fix(autocomplete): persist last selected item position

* chore(changeset): add changeset

* chore(deps): bump framer-motion version (#5287)

* chore(deps): bump framer-motion version

* fix: typing issues

* chore(changeset): add changeset

---------

Co-authored-by: Junior Garcia <[email protected]>

* chore(docs): supplement onAction & selectionBehavior (#5289)

* fix(autocomplete): ensure focused item matches selected item after filter, selection (#5290)

* fix(autocomplete): ensure focused item matches selected item after filter, selection

* chore: apply type and default value

* chore: add perpose coment in updated code

* test: add focuskey management testcode

* docs: add changeset

* docs: update changeset

* chore: remove comment

* fix: broken components in stories (#5291)

* chore(switch): remove xl size

* chore(docs): remove xl size

* chore(system-rsc): remove xl size

* chore(circular-progress): remove xl size

* chore: undo

* chore(deps): bump RA versions (#5310)

* chore(deps): ra version bump

* chore(changeset): add changeset

* fix(scripts): incorrect docs path

---------

Co-authored-by: Junior Garcia <[email protected]>

* chore(docs): update meta data (#5311)

* docs(layout.tsx): added text-foreground (#5316)

* feat(tabs): add click handling for tab items in tests and implementation (#3917)

Co-authored-by: WK Wong <[email protected]>

* fix issues in tabs examples (#2405)

Co-authored-by: WK Wong <[email protected]>

* chore(docs): add missing onValueChange in CheckboxGroup (#5332)

* ci(changesets): version packages (#5323)

Co-authored-by: Junior Garcia <[email protected]>

* chore: remove pre.json

---------

Co-authored-by: Junior Garcia <[email protected]>
Co-authored-by: Vishv Salvi <[email protected]>
Co-authored-by: KumJungMin <[email protected]>
Co-authored-by: liaoyinglong <[email protected]>
Co-authored-by: zhengjitf <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants