npx skills add https://github.com/microsoft/vscode --skill hygieneVS Code 会通过 git 预提交钩子运行代码规范检查。如果检查未通过,提交将被拒绝。
在宣布工作完成之前,务必运行预提交代码规范检查。 这能捕获那些会阻止提交的问题。
要对已暂存的文件运行代码规范检查:
npm run precommit
这会执行 node --experimental-strip-types build/hygiene.ts,该命令仅扫描已暂存的文件(来自 git diff --cached)。
要直接检查特定文件(无需先暂存它们):
node --experimental-strip-types build/hygiene.ts path/to/file.ts
代码规范检查器会扫描暂存文件中的问题,包括但不限于:
// allow-any-unicode-next-line 或 // allow-any-unicode-comment-file 来抑制此检查。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
"双引号"。其他所有地方都使用 '单引号'。Format Document 来修复)。每周安装量
201
代码仓库
GitHub 星标数
183.0K
首次出现
2026年2月20日
安全审计
安装于
gemini-cli201
codex201
amp201
github-copilot201
kimi-cli201
opencode201
VS Code runs a hygiene check as a git pre-commit hook. Commits will be rejected if hygiene fails.
Always run the pre-commit hygiene check before declaring work complete. This catches issues that would block a commit.
To run the hygiene check on your staged files:
npm run precommit
This executes node --experimental-strip-types build/hygiene.ts, which scans only staged files (from git diff --cached).
To check specific files directly (without staging them first):
node --experimental-strip-types build/hygiene.ts path/to/file.ts
The hygiene linter scans staged files for issues including (but not limited to):
// allow-any-unicode-next-line or // allow-any-unicode-comment-file."double quotes" for externalized (localized) strings. Use 'single quotes' everywhere else.Format Document to fix).Weekly Installs
201
Repository
GitHub Stars
183.0K
First Seen
Feb 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli201
codex201
amp201
github-copilot201
kimi-cli201
opencode201
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
111,800 周安装