Skip to content

feat(oxlint-config-smarthr): Oxlint のための共通設定パッケージを追加#1239

Merged
s-sasaki-0529 merged 27 commits into
masterfrom
feat/add-oxlint-config-smarthr
Apr 14, 2026
Merged

feat(oxlint-config-smarthr): Oxlint のための共通設定パッケージを追加#1239
s-sasaki-0529 merged 27 commits into
masterfrom
feat/add-oxlint-config-smarthr

Conversation

@s-sasaki-0529
Copy link
Copy Markdown
Contributor

@s-sasaki-0529 s-sasaki-0529 commented Apr 13, 2026

なに

oxlint-config-smarthr パッケージを新たに追加します。

なぜ

Oxlint では、ESLint プラグインをそのまま使用することができるます。

各プロダクトが ESLint から Oxlint にスムーズに移行するために、eslint-config-smarthr と互換性のある、Oxlint 向け設定ファイルを、oxlint-config-smarthr として提供します。

どうやった

設定ファイルの内容は、現状の eslint-config-smarthr の設定を概ね引き継ぎつつ、Oxlint 本体に組み込まれたカスタムルール (eslint-config-react など) は、設定から除外しています

確認方法

動作自体は、担当プロダクトの方の oxlint 移行で、本パッケージを取り込んで意図通りに扱えることを確認しています。

設定ファイルをfmfmして大きな認識ズレがなければ、v0.1.0 としてリリースさせてください。

eslint-config-smarthr の oxlint 版として、プロダクト横断で共有する
oxlint 設定パッケージを追加する。初期段階のため private: true。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@s-sasaki-0529 s-sasaki-0529 requested a review from a team as a code owner April 13, 2026 06:45
@s-sasaki-0529 s-sasaki-0529 requested review from diescake and yt-ymmt and removed request for a team April 13, 2026 06:45
@s-sasaki-0529 s-sasaki-0529 marked this pull request as draft April 13, 2026 06:46
@s-sasaki-0529 s-sasaki-0529 changed the title feat(oxlint-config-smarthr): add sharable oxlint config package feat(oxlint-config-smarthr): Oxlint のための共通設定パッケージを追加 Apr 13, 2026
s-sasaki-0529 and others added 10 commits April 13, 2026 15:57
private: true を解除し、release-please の設定に追加することで
マージ時に v0.0.1 として npm にリリースされるようにする。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
release-please が自動管理するため手動追加を取り消す。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… off

明示的な rules が categories より優先されるため、
correctness カテゴリを off にする必要はない。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tsgo が必要なため、typeAware は各プロダクト側で設定する責務とする。
README に type-aware linting の設定方法を追記。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jsPlugins 経由で動作するため、コメントアウトを解除して
eslint-config-smarthr のデフォルト値 (warn) で有効化する。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
commonjs: true,
es2016: true,
},
rules: {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

eslint-config-smarthr 側と限りなく同じです。ビルトイン化されたプラグインの詳細設定まで完璧に同じとは言い切れないですが‥…。
https://github.com/kufu/tamatebako/blob/748b46c97c3ea2b15e59c1b90e53fa3769960ca3/packages/oxlint-config-smarthr/index.js

Comment thread packages/oxlint-config-smarthr/README.md Outdated
Comment thread packages/oxlint-config-smarthr/README.md Outdated
s-sasaki-0529 and others added 6 commits April 13, 2026 16:29
PR 上で oxlint-config-smarthr のプレビューリリースを
公開し、ローカル環境でのデバッグを可能にする。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- typescript/dot-notation を type-aware 必須のためデフォルトから除外
- unicorn プラグインを削除(使用ルールなし)
- previewRelease ワークフローに paths フィルタを追加
- README の plugins 再宣言について補足コメントを追加
- repository.url を SSH 形式に統一
- LICENSE の Copyright 年を 2026 に修正

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 13, 2026

Open in StackBlitz

npm i https://pkg.pr.new/kufu/tamatebako/oxlint-config-smarthr@1239

commit: 3da0f18

s-sasaki-0529 and others added 3 commits April 13, 2026 17:09
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- no-shadow の不要な配列記法を修正
- TypeScript override での severity 変更理由をコメントで補足
- no-unused-vars が correctness カテゴリで有効である旨をコメント追加

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
s-sasaki-0529 and others added 2 commits April 13, 2026 17:30
config をインポートしてオブジェクトとして評価できることを確認する。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
vitest の smoke test を oxlint --print-config に置き換え。
設定ファイルの構文エラーやルール名の typo を検出できる。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- uses: actions/setup-node@v6
with:
node-version-file: '.node-version'
- run: pnpx pkg-pr-new publish packages/oxlint-config-smarthr
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📝 smarthr-ui パッケージで昨年から導入しているプレリリースの仕組みを、tamatebako でも使いたく導入しています。とりあえず影響範囲を最小にするために本パッケージでのみにしてますが、トリガーのオプションを調整することで任意のパッケージで使用できるはずです。

Comment thread packages/oxlint-config-smarthr/index.js Outdated
s-sasaki-0529 and others added 3 commits April 13, 2026 17:41
typescript プラグインが JS ルールの無効化を自動で処理するため、
手動の overrides は不要。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
eslint-config-smarthr と揃えて { fix: true } オプションを追加。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
*/
const config = {
plugins: ['typescript', 'import', 'react', 'jsx-a11y'],
jsPlugins: ['eslint-plugin-smarthr'],
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📝 名前の通り、plugins は Rust で書かれたビルトインのプラグインで、jsPlugins は ESLint プラグインです。

eslint-config-smarthr が扱っているカスタムルールのうち、eslint-plugin-smarthr だけは組み込まれていない(それはそう) ので、JSのまま読み込む形になります。

@s-sasaki-0529 s-sasaki-0529 marked this pull request as ready for review April 13, 2026 11:27
Comment on lines +43 to +44
この共有設定には `options.typeAware` は含まれていません。
TypeScript の型情報を利用するルール(`typescript/dot-notation` など)を有効にするには、追加パッケージをインストールし、設定ファイルを調整してください。
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📝 ここの扱いはちょっと迷ったけど、tsgo に依存する必要があり、まだ必須とするには速い気がしてるのでこの形にしてます。 TypeScript 7 が出たらもうこのパッケージに入れちゃって良いかも。

@s-sasaki-0529 s-sasaki-0529 requested a review from AtsushiM April 13, 2026 11:31
ESLint / oxlint 併用期間中にルール変更の同期漏れを防ぐため、
両設定ファイルに相互参照のコメントを追加。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@s-sasaki-0529 s-sasaki-0529 requested a review from a team as a code owner April 13, 2026 11:34
"directory": "packages/oxlint-config-smarthr"
},
"scripts": {
"test": "oxlint --config index.js --print-config > /dev/null"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📝 単体テスト的なものですが、eslint-config-smarthr 側でやっているスナップショットの取得は、Oxlint がバイナリで動いてる都合再現できなかったので、設定ファイルの出力ができるかどうかだけを見ています。

少なくとも構文ミスや、存在しないプラグインの参照といったミスがある場合は失敗するようになってます。

@AtsushiM
Copy link
Copy Markdown
Member

@s-sasaki-0529 eslint-config版も並行運用していることもありますし、実際のプロダクトで導入してみてもらって確認、という流れが早そうな気がしています。
懸念などありますか?

@s-sasaki-0529
Copy link
Copy Markdown
Contributor Author

@AtsushiM 弊プロダクトで、pkg-pr-new を使った動作確認までは済んでいるので、一旦 v0.1.0 リリース後にそのまま本導入して、開発プロセス上の不都合が生じなそうなことが見えてきたら全体共有していこうとおもいます!

@s-sasaki-0529 s-sasaki-0529 merged commit c66e5ac into master Apr 14, 2026
8 checks passed
@s-sasaki-0529 s-sasaki-0529 deleted the feat/add-oxlint-config-smarthr branch April 14, 2026 06:40
This was referenced Apr 14, 2026
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