Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #2780

console-cleanup

Skill này làm gì

Skill này kiểm tra JavaScript để tìm các câu lệnh console không nên chạy trên website đang hoạt động. Skill dành cho lập trình viên chuẩn bị script trước khi phát hành.

Khi nào nên dùng

  • ✓Khi script chạy thật có console.log hoặc console.debug.
  • ✓Khi một thông báo gỡ lỗi có thể tiết lộ thông tin riêng tư cho người xem.
  • ✓Khi bạn thiết lập build để tự động loại bỏ ghi log.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/console-cleanup/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy gỡ các log gỡ lỗi khỏi script thanh toán của tôi trước khi chúng ta phát hành.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent tìm các câu lệnh console, xóa chúng hoặc chuyển sang một cơ chế ghi log tắt khi chạy thật, và giữ lại việc ghi log lỗi khi cần thiết.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

Câu hỏi thường gặp

Vì sao câu lệnh console là vấn đề khi chạy thật?

Skill nói chúng có thể làm lộ thông tin nhạy cảm, ảnh hưởng hiệu năng và trông thiếu chuyên nghiệp.

Có thể vẫn ghi log lỗi không?

Có. Skill nói console.error có thể giữ lại nếu cần để theo dõi lỗi.

Có lựa chọn nào tốt hơn log console không?

Các công cụ ghi log nhận biết môi trường hoặc một dịch vụ ghi log chuyên dụng.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2780
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự