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-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.
More from microsoft/vscode
fix-errors
Guidelines for fixing unhandled errors from the VS Code error telemetry dashboard. Use when investigating error-telemetry issues with stack traces, error messages, and hit/user counts. Covers tracing data flow through call stacks, identifying producers of invalid data vs. consumers that crash, enriching error messages for telemetry diagnosis, and avoiding common anti-patterns like silently swallowing errors.
943accessibility
Primary accessibility skill for VS Code. REQUIRED for new feature and contribution work, and also applies to updates of existing UI. Covers accessibility help dialogs, accessible views, verbosity settings, signals, ARIA announcements, keyboard navigation, and ARIA labels/roles.
922azure-pipelines
Use when validating Azure DevOps pipeline changes for the VS Code build. Covers queueing builds, checking build status, viewing logs, and iterating on pipeline YAML changes without waiting for full CI runs.
920memory-leak-audit
Audit code for memory leaks and disposable issues. Use when reviewing event listeners, DOM handlers, lifecycle callbacks, or fixing leak reports. Covers addDisposableListener, Event.once, MutableDisposable, DisposableStore, and onWillDispose patterns.
873sessions
Agents window architecture — covers the agents-first app, layering, folder structure, chat widget, menus, contributions, entry points, and development guidelines. Use when implementing features or fixing issues in the Agents window.
868agent-sessions-layout
Agents workbench layout — covers the fixed layout structure, grid configuration, part visibility, editor modal, titlebar, sidebar footer, and implementation requirements. Use when implementing features or fixing issues in the Agents workbench layout.
866