From 1175c9dca38e7ce5840dec3905586db9e2bbb4c1 Mon Sep 17 00:00:00 2001 From: Gibson Fahnestock Date: Sun, 18 Jun 2017 20:53:54 +0100 Subject: doc: standardize function param/object prop style PR-URL: https://github.com/nodejs/node/pull/13769 Reviewed-By: Vse Mozhet Byt Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Michael Dawson Reviewed-By: Ruben Bridgewater --- doc/STYLE_GUIDE.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'doc/STYLE_GUIDE.md') diff --git a/doc/STYLE_GUIDE.md b/doc/STYLE_GUIDE.md index 34879c1c7c..69bfa86500 100644 --- a/doc/STYLE_GUIDE.md +++ b/doc/STYLE_GUIDE.md @@ -65,8 +65,16 @@ * Make the "Note:" label italic, i.e. `*Note*:`. * Use a capital letter after the "Note:" label. * Preferably, make the note a new paragraph for better visual distinction. +* Function arguments or object properties should use the following format: + * * \`name\` {type|type2} Optional description. \*\*Default:\*\* \`defaultValue\` + * E.g. * `byteOffset` {integer} Index of first byte to expose. **Default:** `0` + * The `type` should refer to a Node.js type or a [JavaScript type][] +* Function returns should use the following format: + * * Returns: {type|type2} Optional description. + * E.g. * Returns: {AsyncHook} A reference to `asyncHook`. -[plugin]: http://editorconfig.org/#download -[Oxford comma]: https://en.wikipedia.org/wiki/Serial_comma [Em dashes]: https://en.wikipedia.org/wiki/Dash#Em_dash +[Javascript type]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Data_structures_and_types +[Oxford comma]: https://en.wikipedia.org/wiki/Serial_comma [The New York Times Manual of Style and Usage]: https://en.wikipedia.org/wiki/The_New_York_Times_Manual_of_Style_and_Usage +[plugin]: http://editorconfig.org/#download -- cgit v1.2.3