hygiene
microsoft/vscode
Enforce VS Code's code quality standards: unicode, quotes, headers, indentation, formatting, and linting.
What is hygiene?
Runs VS Code's pre-commit hygiene checks on staged files to catch code style violations before commit. Covers unicode restrictions, quote rules, copyright headers, indentation, formatting, ESLint, and stylelint. Use this before declaring code changes complete.
- Scans staged files for non-ASCII unicode characters and rejects them unless suppressed
- Enforces single quotes for regular strings and double quotes only for localized/externalized strings
- Validates Microsoft copyright headers are present in all files
- Checks indentation uses tabs only, no spaces
- Verifies TypeScript formatting matches the configured formatter output
- Runs ESLint on TypeScript files
How to install hygiene
npx skills add https://github.com/microsoft/vscode --skill hygiene- Node.js with experimental-strip-types support
- Git repository with staged files or files to check
How to use hygiene
- 1.Run `npm run precommit` to check all staged files before committing
- 2.Or run `node --experimental-strip-types build/hygiene.ts path/to/file.ts` to check specific files directly
- 3.Review any reported violations in the output
- 4.Fix unicode issues by using ASCII equivalents or adding `// allow-any-unicode-next-line` or `// allow-any-unicode-comment-file` suppressions
- 5.Fix quote violations by changing double quotes to single quotes (except for localized strings)
- 6.Add missing copyright headers to new files
- 7.Convert space indentation to tabs
- 8.Run `Format Document` to fix formatting issues
Use cases
- Before committing code changes to catch hygiene violations that would block the commit
- Checking specific files directly without staging them first
- Validating code style compliance in CI/CD pipelines
- Ensuring consistent code formatting across the VS Code codebase
- VS Code contributors
- TypeScript developers working on VS Code
- Teams maintaining strict code style standards
hygiene FAQ
Git commits will be rejected. You must fix all hygiene violations before the commit can proceed.
Add `// allow-any-unicode-next-line` before a single line or `// allow-any-unicode-comment-file` at the top of a file to suppress unicode checks for that scope.
Yes, run `node --experimental-strip-types build/hygiene.ts path/to/file.ts` to check specific files directly.
Use single quotes for regular strings and double quotes only for externalized (localized) strings that will be translated.
No, you must fix violations manually. However, running `Format Document` will fix formatting issues in TypeScript files.
Full instructions (SKILL.md)
Source of truth, from microsoft/vscode.
name: hygiene description: Use when making code changes to ensure they pass VS Code's hygiene checks. Covers the pre-commit hook, unicode restrictions, string quoting rules, copyright headers, indentation, formatting, ESLint, and stylelint. Run the hygiene check before declaring work complete.
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-lineor// 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 Documentto fix). - ESLint: TypeScript files are linted with ESLint.
- Stylelint: CSS files are linted with stylelint.
Related skills
More from microsoft/vscode and the wider catalog.

memory-leak-audit
Audit and fix memory leaks in event listeners, DOM handlers, and disposable patterns.

sessions
Agents window architecture reference for VS Code — layers, layout, session management, and development guidelines.

tool-rename-deprecation
Preserve backward compatibility when renaming tool references by maintaining legacy name arrays.

update-screenshots
Download and commit screenshot baselines from VS Code CI runs after visual changes are detected.

expect
Verify React/web code changes in a real browser before claiming completion.

react-doctor
Scan React code for security, performance, accessibility, and architecture issues with a 0–100 health score.