Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

froggy1014
Copy link
Contributor

@froggy1014 froggy1014 commented Jan 22, 2025

Changes

기존에는 unstable_ts_config라는 flag를 통해서 eslint.config.ts 사용이 가능했지만 이번 업데이트부터 stable로 변경되었습니다.

AS-IS TO-BE
[email protected] [email protected]
pnpm exec eslint --flag unstable_ts_config pnpm exec eslint

Visuals

Checklist

  • Have you written the functional specifications?
  • Have you written the test code?

Additional Discussion Points

Summary by CodeRabbit

Summary by CodeRabbit

  • 개발 도구 및 설정

    • ESLint 설정 간소화: 불필요한 불안정한 TypeScript 플래그 제거
    • Biome 포맷터에 최대 줄 너비 120자 설정 추가
    • 패키지 스크립트 업데이트: 포맷 및 린트 명령어 통합
    • ESLint 버전을 9.17.0에서 9.18.0으로 업그레이드
  • 패키지 구성

    • 여러 패키지의 files 배열 포맷 단일 라인으로 변경
    • 린트 스크립트 표준화 및 간소화
    • Avatar 컴포넌트의 문자열 리터럴 포맷 통일 및 문서화 개선
    • Tooltip 컴포넌트 코드 가독성 향상 및 불필요한 코드 제거

Copy link

changeset-bot bot commented Jan 22, 2025

⚠️ No Changeset found

Latest commit: cf09ad0

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

coderabbitai bot commented Jan 22, 2025

Caution

Review failed

The pull request is closed.

워크스루

이 풀 리퀘스트는 여러 패키지의 package.json 파일과 프로젝트 전반의 린팅 및 포맷팅 구성을 업데이트합니다. 주요 변경 사항은 ESLint의 unstable_ts_config 플래그 제거, Biome 포맷터 설정 추가, 스크립트 단순화 및 통합, 그리고 린트-스테이지드 구성 업데이트를 포함합니다. 이러한 변경은 프로젝트의 코드 품질 도구와 스크립트를 더 간결하고 일관되게 만듭니다.

변경 사항

파일 변경 요약
.templates/component/package.json ESLint 린팅 스크립트에서 --flag unstable_ts_config 제거
.vscode/settings.json eslint.options 구성 블록 완전 제거
biome.json 포맷터 섹션에 lineWidth: 120 추가
package.json 새로운 포맷 및 린트 스크립트 추가, lint-staged 구성 업데이트, ESLint 버전 업그레이드
packages/*/package.json 각 패키지의 files 배열 포맷 단순화, ESLint 스크립트에서 --flag unstable_ts_config 제거

제안된 리뷰어

  • bae-sh
  • heeji289
  • synuns
  • yeojini
  • hy57in
  • kimdaeyeobbb
  • developerjhp
  • SEMIN-97
  • noahluftyang

관련될 수 있는 PR

🐰 코드 정리의 춤을 추자
린트와 포맷의 마법으로
깔끔하게 정돈된 스크립트
토끼의 깔끔함을 담아내네!
🌈✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ea8abd and cf09ad0.

📒 Files selected for processing (2)
  • .templates/component/package.json (1 hunks)
  • scripts/createComponent.ts (5 hunks)

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?

❤️ 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.

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. (Beta)
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/avatar/src/Avatar.tsx 95.23% 1 Missing ⚠️
Files with missing lines Coverage Δ
packages/tooltip/src/Tooltip.tsx 100.00% <100.00%> (ø)
packages/avatar/src/Avatar.tsx 98.07% <95.23%> (ø)

Copy link

@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: 1

🧹 Nitpick comments (1)
packages/tooltip/src/Tooltip.tsx (1)

70-72: 이벤트 핸들러 구현이 개선되었습니다.

마우스와 클릭 이벤트 핸들러가 더 읽기 쉽게 정리되었습니다. 각 트리거 타입에 따른 조건부 처리가 명확합니다.

다만, 접근성 관점에서 한 가지 제안드립니다:

 <Component
   ref={wrapperRef}
   role="tooltip"
   onMouseEnter={trigger === 'hover' ? () => toggleTooltip(true) : undefined}
   onMouseLeave={trigger === 'hover' ? () => toggleTooltip(false) : undefined}
   onClick={trigger === 'click' ? () => toggleTooltip(!isVisible) : undefined}
   onKeyDown={handleKeyDown}
   tabIndex={trigger === 'click' ? 0 : undefined}
+  aria-expanded={isVisible}
   className={clsx(styles.trigger, { [styles.asChild]: asChild })}
 >
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b13476d and 7ea8abd.

📒 Files selected for processing (2)
  • packages/avatar/src/Avatar.tsx (6 hunks)
  • packages/tooltip/src/Tooltip.tsx (2 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
packages/avatar/src/Avatar.tsx

[warning] 78-78: packages/avatar/src/Avatar.tsx#L78
Added line #L78 was not covered by tests

🔇 Additional comments (7)
packages/tooltip/src/Tooltip.tsx (3)

51-55: 코드 구조가 개선되었습니다!

useTooltip 훅의 반환값을 한 줄로 구조 분해하여 코드가 더 간결해졌습니다.


57-57: ref 처리가 적절합니다.

useImperativeHandle을 사용하여 외부에서 wrapper 요소에 접근할 수 있도록 올바르게 구현되었습니다.


83-84: 스타일 적용 방식이 개선되었습니다.

className과 style 속성이 더 명확하게 구성되었습니다. 조건부 클래스 적용과 스타일 오버라이드가 잘 구현되어 있습니다.

packages/avatar/src/Avatar.tsx (4)

Line range hint 1-14: 문서화가 잘 개선되었습니다!

컴포넌트의 크기 옵션에 대한 상세한 설명이 추가되어 가독성이 향상되었습니다.


Line range hint 15-23: 타입 정의와 문서화가 명확합니다.

AvatarShape 타입에 대한 문서화가 잘 되어있으며, 각 옵션의 의미가 명확하게 설명되어 있습니다.


Line range hint 25-32: 인터페이스 정의가 적절합니다.

모든 필요한 프로퍼티가 포함되어 있으며, 선택적 프로퍼티들이 올바르게 정의되어 있습니다.


Line range hint 34-61: 테스트 커버리지 개선이 필요합니다.

컴포넌트 구현은 잘 되어 있지만, 에러 처리와 폴백 로직에 대한 테스트 케이스를 추가하면 좋을 것 같습니다.

테스트 파일을 확인하고 필요한 테스트 케이스를 추가해주시겠어요?

Comment on lines 66 to 90
switch (size) {
case "xs":
return "24px";
case "sm":
return "32px";
case "md":
return "40px";
case "lg":
return "70px";
case "xl":
return "96px";
case 'xs':
return '24px';
case 'sm':
return '32px';
case 'md':
return '40px';
case 'lg':
return '70px';
case 'xl':
return '96px';
default:
return "40px";
return '40px';
}
}

function getAvatarShape(shape: AvatarShape) {
switch (shape) {
case "rounded":
return "4px";
case "square":
return "0px";
case 'rounded':
return '4px';
case 'square':
return '0px';
default:
return "50%";
return '50%';
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

기본값 케이스에 대한 테스트가 누락되었습니다.

getAvatarSize 함수의 기본값 케이스(line 78)에 대한 테스트 커버리지가 누락되어 있습니다.

다음과 같은 테스트 케이스를 추가해주세요:

test('getAvatarSize returns default size for invalid input', () => {
  // @ts-expect-error - Testing invalid input
  expect(getAvatarSize('invalid')).toBe('40px');
});
🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 78-78: packages/avatar/src/Avatar.tsx#L78
Added line #L78 was not covered by tests

@froggy1014 froggy1014 added the documentation Improvements or additions to documentation label Jan 23, 2025
Copy link
Collaborator

@noahluftyang noahluftyang left a comment

Choose a reason for hiding this comment

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

오예~ 👍

@froggy1014 froggy1014 enabled auto-merge (squash) January 26, 2025 07:43
@froggy1014 froggy1014 merged commit 9639905 into main Jan 26, 2025
2 of 3 checks passed
@froggy1014 froggy1014 deleted the chore/update-eslint branch January 26, 2025 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants