Skip to content

feat(cli): ANSI-16 縛りの導入と PLUGIN 色の変更 - #18

Merged
gitt510 merged 2 commits into
mainfrom
20260807-ansi16-eslint
Aug 7, 2026
Merged

feat(cli): ANSI-16 縛りの導入と PLUGIN 色の変更#18
gitt510 merged 2 commits into
mainfrom
20260807-ansi16-eslint

Conversation

@gitt510

@gitt510 gitt510 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Why

  • PLUGIN は「plugin がこの skill を配信している」という読ませたい状態であり、dim はそれをゼロ件カウントと同じ見た目に沈めていた
    • 変更前の severity ladder コメントで dim の意味は「benign by design, or a count of zero」と定義され、PLUGIN とゼロ件表示が同じ描画を共有していた(src/cli.ts
  • TUI の色は端末テーマに追従する ANSI-16 スロットに限定する方針であり、固定パレットを刺す 256-color / truecolor の混入は機械で弾く必要がある
    • paint の全色は ANSI-16 の SGR パラメータ(31–36 系)で構成されている
    • この repo には linter がなく(変更前の package.json に devDependencies なし)、この規約を検査する仕組みが存在しなかった

What

CLI(PLUGIN の描画)

  • paintgold\u001b[93m = ANSI-16 bright yellow)を追加
  • statusColor と doctor 集計列の PLUGIN を paint.dimpaint.gold に変更
  • severity ladder コメントに gold の行を追加、dim は「a count of zero」専用に

ESLint / CI

  • eslint.config.mjs 新規: @eslint/js + typescript-eslint の recommended を適用
  • no-restricted-syntax38;5; / 48;5;(256-color)と 38;2; / 48;2;(truecolor)を src/** 全体で禁止
  • 生のエスケープ(\u001b / \x1b)は src/cli.ts 以外で禁止し、paint.* 経由を強制
  • package.jsonlint script と devDependencies を追加、bun.lock を新規生成
  • justfile の dev group に lint レシピを追加
  • CI に bun install --frozen-lockfilebun run lintbun test の前段として追加

Test

確認 コマンド 結果
lint clean bunx eslint . 0 problems
既存テスト bun test 38 pass / 0 fail
ガード実効性 src/cli.ts93m38;5;178m に置換して bunx eslint . no-restricted-syntax エラー(src/cli.ts:108:42)で fail、復元後 clean

Notes

  • typescript^6 に固定 — typescript-eslint が TS 7.0 未対応のため(Enhancement: Use TS 7 (tsgo / typescript-go) for type information typescript-eslint/typescript-eslint#10940)。対応後にピンを外せる
  • ガードは bun のテストではなく ESLint ルールとして実装 — 規約の置き場を 1 箇所にし、違反行への行単位の指摘を得るため
  • MISSING の yellow(33m)とは別スロット(93m)なので、severity の見分けは端末テーマが normal / bright を区別する限り保たれる

gitt510 and others added 2 commits August 7, 2026 14:37
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gitt510
gitt510 merged commit 88a7bfa into main Aug 7, 2026
2 checks passed
@gitt510
gitt510 deleted the 20260807-ansi16-eslint branch August 7, 2026 05: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