Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0f3901a

Browse filesBrowse files
gibfahnMylesBorins
authored andcommitted
doc: standardize function param/object prop style
Backport-PR-URL: #16560 PR-URL: #13769 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 748d3e5 commit 0f3901a
Copy full SHA for 0f3901a

File tree

Expand file treeCollapse file tree

8 files changed

+270
-235
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

8 files changed

+270
-235
lines changed
Open diff view settings
Collapse file

‎doc/STYLE_GUIDE.md‎

Copy file name to clipboardExpand all lines: doc/STYLE_GUIDE.md
+10-2Lines changed: 10 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,16 @@
5959
* References to constructor instances should use camelCase.
6060
* References to methods should be used with parentheses: for example,
6161
`socket.end()` instead of `socket.end`.
62+
* Function arguments or object properties should use the following format:
63+
* <code>* \`name\` {type|type2} Optional description. \*\*Default:\*\* \`defaultValue\`</code>
64+
* E.g. <code>* `byteOffset` {integer} Index of first byte to expose. **Default:** `0`</code>
65+
* The `type` should refer to a Node.js type or a [JavaScript type][]
66+
* Function returns should use the following format:
67+
* <code>* Returns: {type|type2} Optional description.</code>
68+
* E.g. <code>* Returns: {AsyncHook} A reference to `asyncHook`.</code>
6269

63-
[plugin]: http://editorconfig.org/#download
64-
[Oxford comma]: https://en.wikipedia.org/wiki/Serial_comma
6570
[Em dashes]: https://en.wikipedia.org/wiki/Dash#Em_dash
71+
[Javascript type]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Data_structures_and_types
72+
[Oxford comma]: https://en.wikipedia.org/wiki/Serial_comma
6673
[The New York Times Manual of Style and Usage]: https://en.wikipedia.org/wiki/The_New_York_Times_Manual_of_Style_and_Usage
74+
[plugin]: http://editorconfig.org/#download
Collapse file

‎doc/api/addons.md‎

Copy file name to clipboardExpand all lines: doc/api/addons.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1040,8 +1040,8 @@ has ended but before the JavaScript VM is terminated and Node.js shuts down.
10401040

10411041
#### void AtExit(callback, args)
10421042

1043-
* `callback`: `void (*)(void*)` - A pointer to the function to call at exit.
1044-
* `args`: `void*` - A pointer to pass to the callback at exit.
1043+
* `callback` {void (\*)(void\*)} A pointer to the function to call at exit.
1044+
* `args` {void\*} A pointer to pass to the callback at exit.
10451045

10461046
Registers exit hooks that run after the event loop has ended but before the VM
10471047
is killed.
Collapse file

‎doc/api/assert.md‎

Copy file name to clipboardExpand all lines: doc/api/assert.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ added: v0.1.21
202202
* `actual` {any}
203203
* `expected` {any}
204204
* `message` {any}
205-
* `operator` {string} (default: '!=')
206-
* `stackStartFunction` {function} (default: `assert.fail`)
205+
* `operator` {string} **Default:** '!='
206+
* `stackStartFunction` {function} **Default:** `assert.fail`
207207

208208
Throws an `AssertionError`. If `message` is falsy, the error message is set as
209209
the values of `actual` and `expected` separated by the provided `operator`.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.