Building and Running
Start the Server
Run
./pokemon-showdown to start a local server.Windows users should use
node pokemon-showdown instead of ./pokemon-showdownAccess the Local Server
If your browser forces HTTPS and you cannot access the local server:
- Firefox: Disable “DNS over HTTPS”
- Chrome: Disable “Async DNS resolver” in
chrome://flags
Useful Commands
Explore other command-line options:Getting Started
Bug Fixes
Bug fix pull requests are always welcome
Feature Additions
Discuss feature additions at psim.us/development or psim.us/devdiscord first
Ideas Issue
Check out GitHub Issue #2444 for inspiration
Mechanics Bugs
View the Mechanics Bugs Kanban Board
We try to respond to pull requests within a few days. Feel free to bump your PR if it seems forgotten.
Code Standards
Most code standards are enforced byeslint. Run npm test to check for issues.
String Conventions
Pokemon Showdown uses specific quote styles:Optionals: null vs undefined vs false
Standard convention: Usenull for optionals
false | null | undefined
false= action failednull= action failed silently (suppress “But it failed!” messages)undefined= action should be ignored
Operators: || vs ??
Prefer|| for fallback values:
?? only when 0, '', or false should not trigger fallback.
Comment Standards
C1. Don’t Teach JavaScript
Avoid documenting obvious language features:C2. Document in Names
Use descriptive variable and function names:C3. Doc Comments
Use/** */ comments for information that shows up in editor tooltips:
C4. Explain Complex Code
Comment code that requires domain knowledge:C5. Jokes Are Welcome
Commit Message Standards
CM1. What, Not How
Describe what the code does, not how:CM2. Imperative Mood
Start with imperative verbs:CM3. Grammar Rules
- Keep first line under 50 characters
- Capitalize first letter
- No period at the end
CM4. Tag Your Changes
Prefix commits with the affected component:CM5. Squashing (Optional)
GitHub now supports squash-merging, so squashing commits in pull requests is optional. However:- Commits that fix previous commits in the same PR should be squashed
- Each commit in a rebase-merge should make sense standalone
Rebase Guide - Never close and recreate a broken PR, ask for help instead
Modern JavaScript/TypeScript
We prefer modern syntax supported by the latest Node LTS:| Feature | Status |
|---|---|
.forEach | Avoid - use for...of instead |
.reduce | Usually prefer for...of for readability |
| Multiline template strings | Avoid - explicitly use \n |
async/await | Preferred for readability |
| Getters/setters/Proxy | Avoid magic - be explicit |
| Constant Enums | Don’t use - prefer union types |
| Default Properties | Use |
Dependencies
We avoid adding NPM dependencies casually:We do accept dependencies where they make sense (like SockJS), but evaluate them more critically than most Node projects.
License
All submitted code must be MIT licensed. The GitHub ToS ensures this, but keep it in mind:- Server code: MIT license (inherited from your fork)
- Client code: MIT license (you’ll be asked to confirm on first client PR)
Design Principles
We prioritize usability and accessibility over trendy aesthetics.Less Text is Better
“1234 battles” > “There are currently 1234 active battles being played”
Buttons Say What They Do
Use “[Delete] [Cancel]” instead of “Delete this file? [Yes] [No]”
Remove Unnecessary Clicks
Replace “Are you sure?” dialogs with “Undo” buttons when possible
Remove Unnecessary Scrolling
Use expand/collapse for large content instead of tiny scroll regions
Affordances Matter
Buttons should look like buttons. Clickable things should look clickable.
Feedback is Important
Show loading states, disable clicked buttons, display error messages
Resources
Development Chat
Join the development discussion
Development Discord
Discord server for contributors
Suggestions Forum
Browse approved suggestions
GitHub Repository
Source code and issue tracker
