本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)75k · #2780

console-cleanup

できること

このスキルは、ライブのサイトで実行されるべきでないconsoleの文が、JavaScriptにないかを確認します。公開に向けてスクリプトを準備する開発者向けです。

使う場面

  • ✓本番のスクリプトに、console.logやconsole.debugの呼び出しがあるとき。
  • ✓デバッグのメッセージが、訪問者に非公開の情報を明かすおそれがあるとき。
  • ✓ログを自動で取り除くべきビルドを設定するとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/console-cleanup/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/console-cleanup/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“公開の前に、私のチェックアウトのスクリプトからデバッグ用のログを取り除いてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントはconsoleの文を見つけて取り除くか、本番では無効になるログの仕組みに切り替えます。エラーのログは、必要な場所に残します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Remove console statements in production

Console statements leak sensitive information, impact performance, and create unprofessional user experiences when visible in production.

Quick Reference

  • Remove console.log, console.debug, console.table before production
  • Use environment-aware logging utilities
  • Configure build tools to strip console statements automatically
  • Keep console.error for critical error tracking if needed

Check

Scan this JavaScript code for console.log, console.debug, console.warn, console.error, and other console statements that should be removed before production deployment.

Fix

Remove or conditionally disable console statements for production, or replace them with a proper logging service.

Explain

Explain why console statements should be removed from production code and alternatives for logging.

Code Review

Review scripts, client components, and browser execution paths related to Remove console statements in production. Flag exact imports, event handlers, runtime side effects, or blocking operations that violate the rule, and state how the change should be verified in the browser.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/javascript/console-cleanup

よくある質問

本番でconsoleの文は、なぜ問題ですか?

機密の情報を漏らしたり、性能に影響したり、プロフェッショナルに見えなかったりするおそれがあると、このスキルは説明しています。

エラーのログは残せますか?

はい。エラーの追跡に必要なら、console.errorは残せると、このスキルは説明しています。

consoleのログの良い代わりは何ですか?

環境に応じて切り替わるログのツール、または適切なログのサービスです。

詳細

作者による元の説明

Use when reviewing scripts, client components, bundles, or runtime behavior related to Remove console statements in production. Inspect both source code and the browser execution path so fixes target the real bottleneck or bug.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2780
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル