You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 635e09d
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,6 +99,42 @@ the macOS native vibrancy material, which Chromium cannot render.
99
99
- See [ARCHITECTURE.md](./ARCHITECTURE.md) for the renderer's module layering, state ownership, and side-effect conventions.
100
100
- Keep commit messages clear and descriptive.
101
101
102
+
#### 📝 TSDoc
103
+
104
+
Every TSDoc block follows the [TSDoc][tsdoc-website] standard. Add TSDoc to
105
+
exported APIs whose contract is not obvious from the signature; trivial
106
+
presentational components may omit it. Existing files are not the standard:
107
+
proposals and new changes follow this section.
108
+
109
+
- Start with a one-sentence summary.
110
+
- Document every parameter with `@param name - description`. Put optional or
111
+
default behaviour in the description; never add JSDoc type annotations.
112
+
- Use `@returns` (not `@return`) for every non-void return. Describe the
113
+
resolved value, its format, or its success and failure branches. Do not
114
+
repeat the TypeScript type or write "Promise resolving to".
115
+
- Let named result types own object shapes. Document fields on the type, then
116
+
name or link the type from `@returns` instead of restating the shape.
117
+
- Use `@throws` for each thrown error condition, `@remarks` for extended
118
+
context, `@example` for non-obvious usage, and `@typeParam` for generic
119
+
parameters.
120
+
- Use `{@link Symbol}` for internal references and backticks for identifiers
121
+
and literals.
122
+
- Omit `@returns` for `void` and `Promise<void>`.
123
+
- Update TSDoc in the same pull request as the behaviour change. Do not
124
+
suppress a TSDoc lint finding; fix it or change this convention in a separate
125
+
proposal.
126
+
127
+
```ts
128
+
/**
129
+
* Read the token the locally installed GitHub CLI holds for a host.
130
+
*
131
+
* @paramhostname - Host to read the token for (e.g. `github.com`).
132
+
* @returns The CLI token, or a classified failure with an optional detail line.
133
+
*/
134
+
```
135
+
136
+
TSDoc syntax is validated by the shared lint configuration through `pnpm check`.
137
+
102
138
### 🐛 How to Report Bugs or Request Features
103
139
104
140
If you encounter a bug or have a feature request, please [open an issue][github-issues] with clear steps to reproduce or a detailed description of your idea. Check for existing issues before creating a new one.
0 commit comments