From 4b42917f613650acd575ac0c411fa88c641aec7d Mon Sep 17 00:00:00 2001 From: Kato Hiroki Date: Mon, 23 Mar 2026 13:46:45 +0000 Subject: [PATCH 01/17] docs: Add oxlint/oxfmt migration plan Co-Authored-By: Claude Sonnet 4.6 --- .../2026-03-23/oxlint-oxfmt-migration/plan.md | 163 ++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 docs/dev-notes/2026-03-23/oxlint-oxfmt-migration/plan.md diff --git a/docs/dev-notes/2026-03-23/oxlint-oxfmt-migration/plan.md b/docs/dev-notes/2026-03-23/oxlint-oxfmt-migration/plan.md new file mode 100644 index 000000000..db12216b2 --- /dev/null +++ b/docs/dev-notes/2026-03-23/oxlint-oxfmt-migration/plan.md @@ -0,0 +1,163 @@ +# ESLint → oxlint / Prettier → oxfmt 移行互換性調査 + +## 概要 + +ファイル数が300程度となり、lint/fmt 実行のたびに待ち時間が発生している。 +oxlint(50–100x 高速)と oxfmt(30x 高速)への移行で DX を改善することを検討。 +ただし Svelte + Tailwind のプラグイン依存があるため、完全互換性を事前に確認した。 + +関連 issue: [#2226](https://github.com/AtCoder-NoviSteps/AtCoderNoviSteps/issues/2226) + +--- + +## 現在の構成 + +### ESLint (`eslint.config.mjs`) + +| 依存 | 用途 | +| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `@eslint/js` | JS 推奨ルール | +| `@typescript-eslint/eslint-plugin` | TS ルール(ban-ts-comment, no-unused-vars, no-explicit-any) | +| `@typescript-eslint/parser` | TS パーサー | +| `eslint-plugin-svelte` + `svelte-eslint-parser` | Svelte 固有ルール(require-each-key, no-useless-mustaches, prefer-writable-derived, valid-prop-names-in-kit-pages) | +| `globals` | ブラウザ/Node グローバル + Svelte 5 runes グローバル定義 | + +### Prettier (`.prettierrc` + `prettier.config.js`) + +| 依存 | 用途 | +| ----------------------------- | -------------------------------- | +| `prettier-plugin-svelte` | `.svelte` ファイルのフォーマット | +| `prettier-plugin-tailwindcss` | Tailwind クラスのソート | + +### Pre-commit (Lefthook) + +```yaml +- name: format + run: pnpm exec prettier --write {staged_files} + glob: '**/*.{js,jsx,ts,tsx,md,svelte}' + +- name: eslint + run: pnpm exec eslint {staged_files} + glob: '**/*.{js,jsx,ts,tsx,svelte}' +``` + +--- + +## oxlint 互換性調査 + +### ルール対応状況 + +| ルール / プラグイン | 対応 | 備考 | +| ------------------------------------ | ------------- | ------------------------------------------------------------------------- | +| JS 推奨ルール(`@eslint/js`) | ✅ | 699ルール中108がデフォルト有効 | +| `@typescript-eslint/no-unused-vars` | ✅ | | +| `@typescript-eslint/no-explicit-any` | ✅ | | +| `@typescript-eslint/ban-ts-comment` | ✅ | `allow-with-description` オプションの挙動は実装時に要検証 | +| `eslint-plugin-svelte` | ❌ **未対応** | Svelte プラグイン自体が存在しない | +| `.svelte` ファイルの lint | ⚠️ 部分的 | `