
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
code-comment-check
Advanced tools
> ๐ง ไธไธช่ฝป้ใๅฟซ้็ๅฝไปค่กๅทฅๅ ท๏ผ็จไบๅจๆไบคไปฃ็ ๅๆฃๆฅๅ้ๅฃฐๆๆฏๅฆ็ผบๅฐๆณจ้ใ > ้่ฟ็ฎๅ็ CLI๏ผไธ้ฎ็กฎไฟๅข้ไปฃ็ ็ๅฏ่ฏปๆงไธไธ่ดๆงใ
๐ง 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 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ src/utils/math.ts โ 12 โ const totalPrice = ... โ
โ src/components/Button.tsx โ 45 โ let isDisabled = false โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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 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.
The npm package code-comment-check receives a total of 7 weekly downloads. As such, code-comment-check popularity was classified as not popular.
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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.