hygiene

Validate staged files against VS Code hygiene standards with the build/hygiene.ts script.

189k|41.5k|Updated Sep 3, 2015
One-click install
npx skills add https://github.com/microsoft/vscode --skill hygiene-microsoft
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hygiene
Source: https://github.com/microsoft/vscode/tree/main/.github/skills/hygiene
Command: npx skills add https://github.com/microsoft/vscode --skill hygiene-microsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill ensures that code changes adhere to VS Code's strict coding standards and formatting rules, preventing commits that would fail automated checks and maintaining code consistency.

Core Features & Use Cases

  • Pre-commit Hook Enforcement: Catches hygiene issues before they are committed, saving developers time by preventing failed builds.
  • Comprehensive Linting: Checks for unicode restrictions, correct string quoting, copyright headers, indentation, formatting, ESLint, and Stylelint.
  • Use Case: Before submitting a pull request, run the hygiene check to guarantee your code meets all project standards, ensuring a smoother review process.

Quick Start

Run the hygiene check on your staged files using the command npm run precommit.

Frequently Asked Questions about hygiene

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run pre-commit checks to validate code against VS Code hygiene standards?

Run pre-commit checks to validate code against VS Code hygiene standards by executing `npm run precommit`. This triggers the `build/hygiene.ts` script to validate staged files before finalizing your commit.

What formatting and linting rules does the VS Code hygiene check enforce?

The VS Code hygiene check enforces formatting and linting rules including unicode restrictions, string quoting, copyright headers, indentation, formatting, ESLint, and Stylelint to maintain code quality and consistency.

Why do I need to stage files before running code quality checks?

You need to stage files before running code quality checks because the `build/hygiene.ts` script specifically validates staged files. This pre-commit hook enforcement catches hygiene issues before they are committed.

Can I use Stylelint and ESLint together for CSS and TypeScript formatting in VS Code?

Yes, you can use Stylelint and ESLint together for CSS and TypeScript formatting in VS Code. The hygiene check integrates both tools to comprehensively validate code changes against project standards before submission.

What is the best way to ensure my pull request passes VS Code coding standards?

The best way to ensure your pull request passes VS Code coding standards is to run the hygiene check on your staged files using `npm run precommit` before submission, guaranteeing a smoother review process.