-
Notifications
You must be signed in to change notification settings - Fork 21
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
chore(lint): fix lint error of biomejs #59
Conversation
refactor: refactor the structure of kawa-ui&kawa-foundation
Feat shabix
chore(lint): resolve lint error of biome
WalkthroughThis pull request introduces changes to several files across the project. The modifications include updating the Changes
Possibly related PRs
Suggested Reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.gitignore
(1 hunks)docs/components/_meta.json
(1 hunks)packages/components/image/Image.tsx
(1 hunks)packages/components/list/list.tsx
(1 hunks)packages/components/package.json
(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- docs/components/_meta.json
- packages/components/package.json
- .gitignore
🔇 Additional comments (2)
packages/components/image/Image.tsx (1)
6-6
: LGTM: Removed unused onClick propGood cleanup to satisfy the BiomeJS linter by removing the unused onClick prop from destructuring.
packages/components/list/list.tsx (1)
12-12
: Excellent improvement: Using semantic list elementsGood refactoring to use proper
<ul>
and update the ref type accordingly. This improves accessibility and semantic correctness of the HTML structure.Also applies to: 15-15, 19-19
<div key={index} role="listitem"> | ||
{renderItem(item, index)} | ||
</div> | ||
<li key={crypto.randomUUID()}>{renderItem(item, index)}</li> |
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.
Critical: Avoid using randomUUID for list keys
Using crypto.randomUUID()
for list keys is problematic because:
- It generates new keys on every render, defeating React's reconciliation
crypto.randomUUID()
may not be available in all environments- For static lists where items aren't reordered, the index is actually more appropriate
Apply this change:
- <li key={crypto.randomUUID()}>{renderItem(item, index)}</li>
+ <li key={index}>{renderItem(item, index)}</li>
If you need stable keys for reorderable lists, consider requiring an id
field in your data items instead.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
<li key={crypto.randomUUID()}>{renderItem(item, index)}</li> | |
<li key={index}>{renderItem(item, index)}</li> |
Summary by CodeRabbit
Release Notes
New Features
Improvements
Technical Updates
.gitignore
to exclude specific documentation metadata fileThese updates enhance the documentation and component structure with improved semantic markup and metadata management.