Thanks for your interest in contributing! This guide covers the repo setup, tooling, and conventions you need to know.
Clone the repo and install the root dependencies:
git clone https://github.com/MetaMask/metamask-connect-examples.git
cd metamask-connect-examples
pnpm installThis installs the shared dev tooling and sets up Husky pre-commit hooks automatically via the prepare script.
To work on a specific quickstart or integration, install its dependencies separately:
cd quickstarts/evm/react
pnpm installmetamask-connect-examples/
├── quickstarts/
│ └── evm/
│ ├── javascript/
│ └── react/
├── integrations/
│ └── wagmi/
├── eslint.config.js # Root ESLint config (repo-wide)
├── .prettierrc # Prettier config
├── .editorconfig # Editor settings
└── package.json # Root dev tooling
Each quickstart under quickstarts/ and integration under integrations/ is a standalone project with its own package.json, dependencies, and lockfile. End users clone individual projects, so they must work independently without the root tooling.
ESLint is configured at the root with layered rules:
- Base
@eslint/jsrecommended rules for all JavaScript files typescript-eslintrecommended rules for TypeScript files in React projectseslint-plugin-react-hooksandeslint-plugin-react-refreshfor React projectseslint-config-prettierto prevent conflicts with Prettier
pnpm lint # Check for lint errors
pnpm lint:fix # Auto-fix lint errorsPrettier enforces consistent formatting across the entire repo:
- No semicolons
- Single quotes
- Trailing commas
- 100 character line width
- 2 space indentation
pnpm format # Format all files
pnpm format:check # Check formatting without writing changesHusky runs lint-staged before every commit. This automatically:
- Runs ESLint with
--fixon staged.js,.ts, and.tsxfiles - Runs Prettier on all staged files (JS, CSS, JSON, Markdown, HTML, YAML)
You don't need to run lint or format manually before committing -- the hook handles it.
For quickstarts, create a new directory under quickstarts/{chain}/{framework}/.
For integrations, create a new directory under integrations/{library}/.
In either case:
- Include a self-contained
package.jsonwithdev,build,lint, andpreviewscripts - Include a
.gitignorethat coversnode_modules,dist,.env, and editor files - Include a
.env.examplewith required environment variables - Include a
README.mdfollowing the existing pattern (clone instructions, setup steps, run command) - If using React/TypeScript, include an
eslint.config.jsandtsconfig.jsonfor standalone use - Add the root
eslint.config.jsTypeScript/React rules for the new directory
Write clear, concise commit messages. Use the imperative mood:
add EVM React quickstartfix wallet connection error handlingupdate project dependencies
- Create a feature branch from
main - Make sure
pnpm lintandpnpm format:checkpass from the root - If you modified a quickstart or integration, verify it runs with
pnpm devfrom that project directory - Open a PR with a description of what changed and why
By contributing, you agree that your contributions will be licensed under the MIT License.