Skip to content

Commit e103e03

Browse files
gibfahnmatejkrajcovic
authored andcommitted
doc: standardize function param/object prop style
PR-URL: nodejs#13769 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent b0fadbe commit e103e03

File tree

8 files changed

+239
-233
lines changed

8 files changed

+239
-233
lines changed

doc/STYLE_GUIDE.md

+10-2
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

doc/api/addons.md

+2-2
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.

doc/api/assert.md

+2-2
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)