chore: eslint-config-smarthr を v14.6.0 に更新#6392
Open
AtsushiM wants to merge 20 commits into
Open
Conversation
commit: |
73d1b75 to
7f9d26d
Compare
eslint-config-smarthrをv14.0.1からv14.6.0にアップデートし、
新しく追加されたルールに対応。
変更内容:
- eslint-config-smarthr: v14.0.1 → v14.6.0
- eslint-plugin-smarthr: v6.12.1 → v6.19.0
- プロダクト向けルールをoff設定
- best-practice-for-consecutive-definition-list
- best-practice-for-default-props
- design-system-guideline-bulk-action-row-button
- バレルimport対応
- themes/index.ts に不足exportを追加
- src/index.ts でバレル経由に変更
- src/tailwind/*.ts でバレル経由に変更
- src/intl/locales/index.ts に eslint-disable 追加
- pnpm-workspace.yaml
- minimumReleaseAge を一時的に 0 に設定
(マージ時には7日経過しているため問題なし)
- minimumReleaseAgeExclude にパッケージを追加
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
7f9d26d to
5756dca
Compare
変数が条件分岐内でのみ使用される場合、自動的に使用箇所に移動されるようにする。 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- best-practice-for-lazy-variable、best-practice-for-no-unnecessary-variableのレベルをwarnからerrorに変更 - テストファイル(*.test.ts, *.test.tsx)とStorybookファイル(*.stories.tsx, .storybook)ではこれらのルールを無効化 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Componentは2箇所で使用されているため、best-practice-for-no-unnecessary-variableの誤検知を除外 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
AtsushiM
commented
Jun 16, 2026
Comment on lines
-18
to
-27
| const calculateColumnWidths = () => | ||
| Object.fromEntries<string>( | ||
| Array.from({ length: MAX_COLUMN_LENGTH }, (_, i) => { | ||
| const colNum = i + 1 | ||
| const columnWidth = baseColumnWidth * colNum + GUTTER * (colNum - 1) | ||
| return [`col${colNum}`, `${columnWidth}px`] | ||
| }), | ||
| ) as Record<`col${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12}`, PixelWidth> | ||
|
|
||
| const primitiveTokens = calculateColumnWidths() |
Member
Author
There was a problem hiding this comment.
calculateColumnWidths() == primitiveTokens == defaultWidth であり、calculateColumnWidthsはdefaultWidthのためだけに生成されている状態でした。
引数などもなく、結果は常に一定のため、関数として存在させる意味はなかったため整理しています
AtsushiM
commented
Jun 16, 2026
|
|
||
| const isIphone = ua.indexOf('iphone') !== -1 | ||
| const isIpod = ua.indexOf('ipod') !== -1 | ||
| const isIpad = ua.indexOf('ipad') !== -1 |
Member
Author
There was a problem hiding this comment.
isIpadは利用されない場合があるため移動しました。
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
テストファイルでは可読性のために中間変数を使用することが多いため、 __tests__ディレクトリ以下のファイルをルール対象外としました。 - eslint.config.mjsのfilesパターンに**/__tests__/**を追加 - createShadow.tsを元の状態(変数使用)に戻す Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…/LanguageSwitcher.tsx
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
関連URL
なし
概要
eslint-config-smarthr を v14.0.1 から v14.6.0 にアップデートしました。新しく追加されたルールに対応し、バレルimportの使用を徹底しました。
変更内容
1. eslint-config-smarthr のバージョンアップ
2. プロダクト向けルールをoff設定
smarthr-uiはコンポーネントライブラリであるため、プロダクト側でのコンポーネント使用方法を制約するルールは不要です。以下のルールをoffに設定しました:
smarthr/best-practice-for-consecutive-definition-listsmarthr/best-practice-for-default-propssmarthr/design-system-guideline-bulk-action-row-button3. バレルimport対応
smarthr/require-barrel-importルールが強化されたため、以下の修正を実施:themes/index.ts に不足exportを追加:
src/index.ts でバレル経由に変更:
src/tailwind/*.ts でバレル経由に変更:
src/intl/locales/index.ts に eslint-disable 追加:
このファイルはバレルファイルですが、localeオブジェクトを構築する実装を含むため、ルールを無効化しました。
4. pnpm設定の一時的な変更
pnpm-workspace.yaml:
minimumReleaseAgeを一時的に 0 に設定minimumReleaseAgeExcludeにパッケージを追加注意: マージ後、
minimumReleaseAge: 10080に戻す必要があります。プロダクト側で対応が必要な事項
なし(smarthr-ui内部の開発環境の変更のみです)
確認方法
以下のコマンドで全てのチェックが通ることを確認:
Chromatic でのビジュアルリグレッションテストも確認してください。