hygiene

VS Code runs a hygiene check as a git pre-commit hook. Commits will be rejected if hygiene fails.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "hygiene" with this command: npx skills add microsoft/vscode/microsoft-vscode-hygiene

Hygiene Checks

VS Code runs a hygiene check as a git pre-commit hook. Commits will be rejected if hygiene fails.

Running the hygiene check

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

What it checks

The hygiene linter scans staged files for issues including (but not limited to):

  • Unicode characters: Non-ASCII characters (em-dashes, curly quotes, emoji, etc.) are rejected. Use ASCII equivalents in comments and code. Suppress with // allow-any-unicode-next-line or // allow-any-unicode-comment-file .

  • Double-quoted strings: Only use "double quotes" for externalized (localized) strings. Use 'single quotes' everywhere else.

  • Copyright headers: All files must include the Microsoft copyright header.

  • Indentation: Tabs only, no spaces for indentation.

  • Formatting: TypeScript files must match the formatter output (run Format Document to fix).

  • ESLint: TypeScript files are linted with ESLint.

  • Stylelint: CSS files are linted with stylelint.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

accessibility

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

fix-errors

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

sessions

No summary provided by upstream source.

Repository SourceNeeds Review