Contributing to vscode-snippets
January 4, 2026 · View on GitHub
Thank you for your interest in contributing! This guide will help you get started.
Development Setup
Prerequisites
Getting Started
-
Fork and clone the repository
-
Install dependencies:
pnpm install -
Build the snippets:
pnpm build
Project Structure
src/ # Source snippet definitions (edit these)
├── javascript/ # JS-only snippets
├── javascriptreact/ # JSX snippets
├── typescript/ # TS-only snippets
├── typescriptreact/ # TSX snippets
└── markdown/ # Markdown snippets
snippets/ # Generated output (do not edit directly)
scripts/ # Build scripts
Adding or Modifying Snippets
Where to Add Snippets
- JavaScript snippets (
src/javascript/): Available in.js,.jsx,.ts,.tsx - JavaScript React snippets (
src/javascriptreact/): Available in.jsx,.tsx - TypeScript snippets (
src/typescript/): Available in.ts,.tsx - TypeScript React snippets (
src/typescriptreact/): Available in.tsxonly - Markdown snippets (
src/markdown/): Available in.md
Snippet Format
Each snippet follows the VS Code snippet format:
{
"Snippet Name": {
"prefix": "triggerKeyword",
"body": ["line1", "line2", "\$0"],
"description": "Brief description of what this snippet does"
}
}
- Use
$1,$2, etc. for tab stops - Use
$0for the final cursor position - Use
${1:placeholder}for tab stops with default values
Building After Changes
After modifying snippets in src/, regenerate the output files:
pnpm build
This merges snippets hierarchically and outputs to snippets/.
Code Quality
Before submitting, ensure your code passes all checks:
pnpm lint # Run ESLint
The project uses:
- ESLint with flat config for linting
- Prettier for code formatting (runs automatically via lint-staged)
- Husky for pre-commit hooks
Testing Your Changes
- Open the project in VS Code
- Press
F5to launch the Extension Development Host - Create a test file with the appropriate extension
- Test your snippets by typing the prefix and pressing
Tab
Submitting Changes
- Create a new branch for your changes
- Make your changes and commit with a descriptive message
- Push your branch and open a Pull Request
- Describe what your changes do and why
Questions?
If you have questions or run into issues, please open an issue.