Repository navigation
chore: format / lint / CI 基盤の整備(Husky・ESLint・Prettier v3・CI) - #22
Merged
Merged
Conversation
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.
3 tasks done
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.
概要
フォーマット / lint / CI の基盤を整備します(TypeScript 移行の前段)。ソースロジックには手を入れず、ツールチェーンのみを追加します。
変更内容
eslint --fix+prettier --writeを強制eslint-config-prettierを併用format:checkスクリプト追加。外部由来のpublic/mermaid.min.cssは再整形対象外に.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-escape1件のみ本PRで修正しています。確認済み
pnpm run format:checkパスpnpm run lintパス(0 errors)pnpm run buildパスpnpm install --frozen-lockfileパス(ロックファイル同期)