-
Notifications
You must be signed in to change notification settings - Fork 34.9k
Coding Guidelines
Copilot edited this page Sep 5, 2025
Β·
28 revisions
These are VS Code coding guidelines. Please also review our Source Code Organisation page.
We use tabs, not spaces.
- Use PascalCase for
type
names - Use PascalCase for
enum
values - Use camelCase for
function
andmethod
names - Use camelCase for
property
names andlocal variables
- Use whole words in names when possible
- Do not export
types
orfunctions
unless you need to share it across multiple components - Do not introduce new
types
orvalues
to the global namespace
- Use JSDoc style comments for
functions
,interfaces
,enums
, andclasses
- Use "double quotes" for strings shown to the user that need to be externalized (localized)
- Use 'single quotes' otherwise
- All strings visible to the user need to be externalized
- Use title-style capitalization for command labels, buttons, and menu items (each word is capitalized).
- Don't capitalize prepositions of four or fewer letters unless it's the first or last word (e.g. "in", "with", "for").
- Use arrow functions
=>
over anonymous function expressions - Only surround arrow function parameters when necessary. For example,
(x) => x + x
is wrong but the following are correct:
x => x + x
(x, y) => x + y
<T>(x: T, y: T) => x === y
- Always surround loop and conditional bodies with curly braces
- Open curly braces always go on the same line as whatever necessitates them
- Parenthesized constructs should have no surrounding whitespace. A single space follows commas, colons, and semicolons in those constructs. For example:
for (let i = 0, n = str.length; i < 10; i++) {
if (x < 10) {
foo();
}
}
function f(x: number, y: string): void { }
- Whenever possible, use in top-level scopes
export function x(β¦) {β¦}
instead ofexport const x = (β¦) => {β¦}
. One advantage of using thefunction
keyword is that the stack-trace shows a good name when debugging.
Project Management
- Roadmap
- Iteration Plans
- Development Process
- Issue Tracking
- Build Champion
- Release Process
- Running the Endgame
- Related Projects
Contributing
- How to Contribute
- Submitting Bugs and Suggestions
- Feedback Channels
- Source Code Organization
- Coding Guidelines
- Testing
- Dealing with Test Flakiness
- Contributor License Agreement
- Extension API Guidelines
- Accessibility Guidelines
Documentation