Conversation
v2.2.1 -> v3.8.1。jsoncファイルの末尾カンマがtrailingComma: "all" に従って追加された(2ファイル)。
vitest v4のprojects APIを使い、unitとe2eの設定を vitest.config.tsにインライン定義で統合する。 --project フラグで個別実行が可能になり、 vitest.e2e.config.tsは不要になったため削除する。
|
Summary by CodeRabbitリリースノート
Walkthroughリポジトリのツール設定を集約・整理し、複数の個別設定ファイルを削除または統合、Vitest をプロジェクト化(unit / e2e)し、型チェックを Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📋 Issue PlannerBuilt with CodeRabbit's Coding Plans for faster development and fewer bugs. View plan used: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request consolidates various tool configurations (Commitlint, Markdownlint, Textlint, Tsup, and Prettier) into package.json and updates several development dependencies, including ESLint and Prettier. The testing infrastructure is refactored to utilize Vitest projects for unit and E2E tests, and the type-checking command is updated to use tsgo. I have no feedback to provide.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Line 50: The `@typescript/native-preview` dependency in package.json is using a
caret range (^7.0.0-dev.20260328.1) which can pull future preview updates and
change type-check results; change the entry for "@typescript/native-preview" to
a strict pinned version (remove the ^ and keep the exact version string
"7.0.0-dev.20260328.1") so the package manager installs that exact preview
release and ensures reproducible type behavior.
In `@vitest.config.ts`:
- Line 14: The projects-level Vitest config is using an unsupported option:
remove the invalid "reporters: [\"verbose\"]" entry from the projects
configuration in vitest.config.ts; instead, make the E2E runner use verbose
output by adding the CLI flag in the npm script (e.g. update the "test:e2e"
script to include --reporter verbose) or set root-level test.reporters if you
want global reporters; target the "reporters" key in the projects block and the
"test:e2e" npm script when making these changes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: d9228706-baf2-4011-93e2-4b9e9e4f9189
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (11)
.changeset/.markdownlint.jsonc.gitignore.markdownlint-cli2.jsonc.prettierignore.prettierrc.js.textlintrc.jsoncommitlint.config.mjspackage.jsontsup.config.tsvitest.config.tsvitest.e2e.config.ts
💤 Files with no reviewable changes (7)
- .markdownlint-cli2.jsonc
- .prettierignore
- .textlintrc.json
- tsup.config.ts
- commitlint.config.mjs
- .prettierrc.js
- vitest.e2e.config.ts
📜 Review details
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-03-24T19:15:37.273Z
Learnt from: 9c5s
Repo: 9c5s/node-tcnet PR: 41
File: src/utils.ts:94-94
Timestamp: 2026-03-24T19:15:37.273Z
Learning: In node-tcnet’s src/utils.ts, the project targets ES2022 with NodeNext and intentionally does not support Node.js 18.0.0. Therefore, you should not add defensive handling for the temporary numeric `family` field (4/6) in `os.networkInterfaces()` that appears in Node 18.0.0 and is fixed starting in 18.1.0. Avoid reintroducing numeric-family handling logic in this codepath since it is unnecessary for the supported runtime versions.
Applied to files:
.gitignore
📚 Learning: 2026-03-20T23:04:42.120Z
Learnt from: 9c5s
Repo: 9c5s/node-tcnet PR: 1
File: lefthook.yml:20-28
Timestamp: 2026-03-20T23:04:42.120Z
Learning: In the `node-tcnet` repository's `lefthook.yml`, `bunx` (Bun's package runner) is intentionally used instead of `npx` for `actionlint`, `zizmor`, and `lefthook` commands because: (1) the `actionlint` npm package is only a stale wasm wrapper (last release Dec 2022) and is not executable via `npx`; (2) `zizmor` has no npm package and is only available via PyPI, Cargo, or system package managers; (3) `lefthook` is a Go binary whose npm wrapper has low reliability. `bunx` is the correct and practical choice for these tools in this project.
Applied to files:
package.json
🔇 Additional comments (4)
.changeset/.markdownlint.jsonc (1)
2-2: 問題なし(表記統一として妥当です)。Line 2 の変更は JSON 形式の統一に留まっており、
first-line-headingルール無効化の意図も明確です。.gitignore (1)
27-29:.tmp/の追加は妥当です。一時ファイルの管理として適切で、既存ルールとの衝突もなく問題ありません。
vitest.config.ts (1)
6-13: projects 統合の構成は明確で良いです
unitとe2eの責務分離、E2E のinclude/globalSetup/testTimeout/ 逐次実行設定が整理されていて、設定の見通しが改善されています。Also applies to: 15-18
package.json (1)
31-40: スクリプト整理と設定集約の方向性は妥当ですVitest の
--project運用への移行と、各種ツール設定のpackage.json集約により、設定点が減って保守しやすくなっています。Also applies to: 70-125
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Around line 48-53: Add an "engines" field to package.json at the top-level to
declare the Node.js version requirement required by ESLint 10; set engines.node
to ">=24.0.0 || ^22.13.0 || ^20.19.0" (or equivalent range string per semver) so
consumers and contributors know the supported Node versions—edit the
package.json root object and add the "engines" key with the Node constraint
string.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: db69bc1b-9ef0-4ec2-88a4-94202b6b4907
📒 Files selected for processing (2)
package.jsonvitest.config.ts
📜 Review details
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: 9c5s
Repo: 9c5s/node-tcnet PR: 56
File: package.json:50-50
Timestamp: 2026-03-28T15:19:16.430Z
Learning: In the `node-tcnet` repository (`package.json`), `typescript/native-preview` (tsgo) is intentionally specified with a caret range (e.g., `^7.0.0-dev.20260328.1`) rather than a pinned version. The rationale is that this is a daily-released preview package where pinning would become stale the next day; reproducibility is ensured via `npm ci` + lockfile instead. Do not suggest strict version pinning for this dependency.
📚 Learning: 2026-03-28T15:19:16.430Z
Learnt from: 9c5s
Repo: 9c5s/node-tcnet PR: 56
File: package.json:50-50
Timestamp: 2026-03-28T15:19:16.430Z
Learning: In the `node-tcnet` repository (`package.json`), `typescript/native-preview` (tsgo) is intentionally specified with a caret range (e.g., `^7.0.0-dev.20260328.1`) rather than a pinned version. The rationale is that this is a daily-released preview package where pinning would become stale the next day; reproducibility is ensured via `npm ci` + lockfile instead. Do not suggest strict version pinning for this dependency.
Applied to files:
package.json
📚 Learning: 2026-03-24T19:15:40.455Z
Learnt from: 9c5s
Repo: 9c5s/node-tcnet PR: 41
File: src/utils.ts:94-94
Timestamp: 2026-03-24T19:15:40.455Z
Learning: In the `node-tcnet` repository (`src/utils.ts`), the project targets ES2022 + NodeNext and does not need to support Node.js 18.0.0. The temporary numeric `family` field (4/6) in `os.networkInterfaces()` introduced in Node.js 18.0.0 and fixed in 18.1.0 does not need to be handled. Suggesting numeric `family` handling for defensive programming is unnecessary for this project.
Applied to files:
package.json
📚 Learning: 2026-03-20T23:04:42.120Z
Learnt from: 9c5s
Repo: 9c5s/node-tcnet PR: 1
File: lefthook.yml:20-28
Timestamp: 2026-03-20T23:04:42.120Z
Learning: In the `node-tcnet` repository's `lefthook.yml`, `bunx` (Bun's package runner) is intentionally used instead of `npx` for `actionlint`, `zizmor`, and `lefthook` commands because: (1) the `actionlint` npm package is only a stale wasm wrapper (last release Dec 2022) and is not executable via `npx`; (2) `zizmor` has no npm package and is only available via PyPI, Cargo, or system package managers; (3) `lefthook` is a Go binary whose npm wrapper has low reliability. `bunx` is the correct and practical choice for these tools in this project.
Applied to files:
package.json
🔇 Additional comments (6)
package.json (5)
50-50:@typescript/native-previewのキャレット指定は意図的です。前回レビューで厳密固定が提案されましたが、このパッケージは毎日リリースされるプレビュー版であり、固定すると翌日には陳腐化します。再現性は
npm ci+ lockfile で担保されています。
37-40: スクリプト変更は適切です。
vitestの--projectフラグ使用とtsgo --noEmitへの移行が、vitest.config.tsの projects 設定および PR 目標(tsc → tsgo 移行)と整合しています。
55-55: Prettier 2 → 3 のメジャーアップグレードです。Prettier 3 ではデフォルト動作が変更されていますが、
prettier設定ブロック(lines 117-125)で明示的にオプションが指定されているため問題ありません。
70-83: commitlint 設定は正常に移行されています。
scope-empty: [2, "always"]によりスコープ付きコミット(例:fix(parser): ...)はエラーになります。これは意図的な制約と理解しました。
84-125: 設定ファイルの集約は適切に行われています。
markdownlint-cli2、textlint、tsup、prettierの設定が正しくpackage.jsonにインライン化されています。tsupの設定は CJS/ESM デュアル出力に対応しており、ビルドパイプラインと整合しています。vitest.config.ts (1)
6-17: LGTM!
projects設定が適切に構成されています。前回レビューで指摘されたreportersオプションは削除され、CLI フラグ(--reporter verbose)へ移行されたことを確認しました。globalSetupパスも正しく設定されています。
Summary
ルートの設定ファイル14個を7個に削減し、開発ツールの依存関係を最新化する。
.prettierrc.js,.prettierignore,.textlintrc.json,commitlint.config.mjs,tsup.config.ts,.markdownlint-cli2.jsonc) をpackage.jsonにインライン化vitest.config.tsとvitest.e2e.config.tsを vitest projects で1ファイルに統合.gitignoreの不要エントリ削除 (.turbo/, 旧設定ファイルの例外)、.tmp/追加依存関係の変更
prettier^2.2.1→^3.8.1eslint^9.39.4→^10.1.0@eslint/js^9.39.4→^10.0.1eslint-plugin-jsdoc^62.8.0→^62.8.1@typescript/native-preview削除されたファイル
.prettierrc.js,.prettierignore,.markdownlint-cli2.jsonc,.textlintrc.json,commitlint.config.mjs,tsup.config.ts,vitest.e2e.config.tsCloses #44
Test plan
npm run typecheck(tsgo)npm run build(tsup from package.json)npm run test(vitest workspace, 189テスト全PASS)npm run lint:ts(eslint v10)npm run format:check(prettier v3)npm run lint:md(markdownlint from package.json)npm run lint:text(textlint from package.json)npm run docs(typedoc)