
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
code-comment-check
Advanced tools
A fast, SWC-powered CLI for enforcing comment standards on variable declarations before commits.
🧠 A lightweight, fast CLI tool that checks whether your variable declarations are properly commented before committing code. Ensure code readability and consistency across your team with one simple command.
Modern projects often enforce strict code style rules — yet comment standards are easy to overlook.
code-comment-check solves exactly that problem:
--strict mode to inspect all declarations in changed files__tests__, .test.ts, .spec.tsx, etc.)Use it in your local workflow or CI pipeline to enforce consistent documentation standards across your team.
# Recommended
pnpm add -D code-comment-check
# Or using npm / yarn
npm install -D code-comment-check
# or
yarn add -D code-comment-check
After installation, the CLI command is automatically registered:
comment-check
pnpm comment-check
Default behavior:
pnpm comment-check --strict
In strict mode, the tool scans all declarations in changed files, making it ideal for code review or CI environments.
In your .husky/pre-commit file, add the following:
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
pnpm comment-check
Effect:
🔍 Checking annotation comments...
⚠️ Missing annotation comments:
┌────────────────────────────────────────┬────────┬────────────────────────────────────────────────────────────┐
│ File │ Line │ Declaration │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 1 │ const test = '123' │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 2 │ let test1 = '123' │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 3 │ var test2 = '123' │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 4 │ export const test3 = '123' │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 5 │ export let test4 = '123' │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 6 │ export var test5 = '123' │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 8 │ interface Type { │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 12 │ type UserType = 'admin' | 'user' │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 14 │ export interface User { │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 20 │ export type UserWithType = User & { │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 24 │ const bb = '123' │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 25 │ const cc = '123' │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 26 │ const dd = '123' │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 28 │ function fn() { │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 32 │ class Test { │
├────────────────────────────────────────┼────────┼────────────────────────────────────────────────────────────┤
│ test/test2.ts │ 38 │ enum TestEnum { │
└────────────────────────────────────────┴────────┴────────────────────────────────────────────────────────────┘
❌ Please add comments before committing your code.
| Feature | Description |
|---|---|
| ⚡️ High performance | Built on the SWC compiler — much faster than Babel |
| 🧩 Zero configuration | Works out of the box, automatically registers the CLI |
| 💬 Clear output | Displays missing comment details in a table |
| 🧠 Smart parsing | Supports Javascript / TypeScript / JSX / TSX syntax |
| 🪶 Lightweight | Non-intrusive — analyzes AST without modifying code |
| 🔧 Extensible | Supports the --strict flag for broader checks |
MIT © 2025 — maintained by laoer536
FAQs
A fast, SWC-powered CLI for enforcing comment standards on variable declarations before commits.
We found that code-comment-check demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.