Skip to content

chore: format / lint / CI 基盤の整備(Husky・ESLint・Prettier v3・CI) - #22

Merged
Shion1305 merged 1 commit into
mainfrom
chore/tooling-husky-eslint-ci
Jul 14, 2026
Merged

Shion1305 merged 1 commit into
mainfrom
chore/tooling-husky-eslint-ci

Conversation

@Shion1305

Copy link
Copy Markdown
Member

概要

フォーマット / lint / CI の基盤を整備します(TypeScript 移行の前段)。ソースロジックには手を入れず、ツールチェーンのみを追加します。

変更内容

項目 内容
Husky + lint-staged pre-commit で staged ファイルに eslint --fix + prettier --write を強制
ESLint フラット設定(typescript-eslint)。browser / webextensions globals、eslint-config-prettier を併用
Prettier v2 → v3 に更新。format:check スクリプト追加。外部由来の public/mermaid.min.css は再整形対象外に
CI .github/workflows/ci.yml — push / PR(main) で format:check → lint → build を実行(pnpm + Node 24)

スクリプト追加

  • format:check … 整形崩れを検知(CI 用)
  • lint / lint:fix … ESLint

設計上の判断

このPRはツール整備が目的のため、ソースコードのロジックは変更していません。既存 JS が抱える構造的な問題(コンテンツスクリプト間で共有される暗黙のグローバル、var の再宣言、未使用コード = 計71件)は ESLint で warn に設定し、CI を通しつつ債務を可視化しています。これらは後続の TypeScript 移行PRでモジュール単位に解消し、その都度 error に戻します(config にコメントで明記)。安全に直せる no-useless-escape 1件のみ本PRで修正しています。

確認済み

  • pnpm run format:check パス
  • pnpm run lint パス(0 errors)
  • pnpm run build パス
  • pnpm install --frozen-lockfile パス(ロックファイル同期)
  • pre-commit フックの実発火を確認

Set up the formatting/linting foundation before the TypeScript migration:

- Add ESLint flat config (typescript-eslint) with browser/webextensions
  globals and eslint-config-prettier. Pre-existing legacy-JS issues
  (implicit cross-script globals, var redeclaration, unused code) are set
  to warn so CI passes; the TypeScript migration restores them to error.
- Add Husky pre-commit hook running lint-staged (eslint --fix + prettier).
- Add scripts: format:check, lint, lint:fix.
- Bump Prettier 2 -> 3; ignore vendored public/mermaid.min.css.
- Add GitHub Actions CI: format:check, lint, build on push/PR to main.
@Shion1305
Shion1305 requested a review from OhVIton as a code owner July 14, 2026 22:22
@Shion1305
Shion1305 merged commit 2dd41fa into main Jul 14, 2026
1 check passed
@Shion1305
Shion1305 deleted the chore/tooling-husky-eslint-ci branch July 14, 2026 22:39
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.

1 participant