Skip to content

Making return type params consistent with the rest of the code base #894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/commands/readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports.builder = {
* Insert API documentation into a Markdown readme
* @private
* @param {Object} argv args from the CLI option parser
* @return {undefined} has the side-effect of writing a file or printing to stdout
* @returns {undefined} has the side-effect of writing a file or printing to stdout
*/
module.exports.handler = function readme(argv: Object) {
argv._handled = true;
Expand Down
12 changes: 6 additions & 6 deletions src/default_theme/assets/anchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
/**
* Checks to see if this device supports touch. Uses criteria pulled from Modernizr:
* https://github.com/Modernizr/Modernizr/blob/da22eb27631fc4957f67607fe6042e85c0a84656/feature-detects/touchevents.js#L40
* @return {Boolean} - true if the current device supports touch.
* @returns {Boolean} - true if the current device supports touch.
*/
this.isTouchDevice = function() {
return !!(
Expand All @@ -62,7 +62,7 @@
* Add anchor links to page elements.
* @param {String|Array|Nodelist} selector - A CSS selector for targeting the elements you wish to add anchor links
* to. Also accepts an array or nodeList containing the relavant elements.
* @return {this} - The AnchorJS object
* @returns {this} - The AnchorJS object
*/
this.add = function(selector) {
var elements,
Expand Down Expand Up @@ -191,7 +191,7 @@
* Removes all anchorjs-links from elements targed by the selector.
* @param {String|Array|Nodelist} selector - A CSS selector string targeting elements with anchor links,
* OR a nodeList / array containing the DOM elements.
* @return {this} - The AnchorJS object
* @returns {this} - The AnchorJS object
*/
this.remove = function(selector) {
var index,
Expand Down Expand Up @@ -227,7 +227,7 @@
* remove extra hyphens, truncate, trim hyphens, and make lowercase.
*
* @param {String} text - Any text. Usually pulled from the webpage element we are linking to.
* @return {String} - hyphen-delimited text for use in IDs and URLs.
* @returns {String} - hyphen-delimited text for use in IDs and URLs.
*/
this.urlify = function(text) {
// Regex for finding the nonsafe URL characters (many need escaping): & +$,:;=?@"#{}|^~[`%!'<>]./()*\
Expand Down Expand Up @@ -258,7 +258,7 @@
* Determines if this element already has an AnchorJS link on it.
* Uses this technique: http://stackoverflow.com/a/5898748/1154642
* @param {HTMLElemnt} el - a DOM node
* @return {Boolean} true/false
* @returns {Boolean} true/false
*/
this.hasAnchorJSLink = function(el) {
var hasLeftAnchor =
Expand All @@ -276,7 +276,7 @@
* It also throws errors on any other inputs. Used to handle inputs to .add and .remove.
* @param {String|Array|Nodelist} input - A CSS selector string targeting elements with anchor links,
* OR a nodeList / array containing the DOM elements.
* @return {Array} - An array containing the elements we want.
* @returns {Array} - An array containing the elements we want.
*/
function _getElements(input) {
var elements;
Expand Down
2 changes: 1 addition & 1 deletion src/extractors/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function walkComments(
* Parse a comment with doctrine and decorate the result with file position and code context.
*
* @param {Object} comment the current state of the parsed JSDoc comment
* @return {undefined} this emits data
* @returns {undefined} this emits data
*/
function parseComment(comment) {
newResults.push(
Expand Down
2 changes: 1 addition & 1 deletion src/filter_access.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { walk } from './walk';
*
* @param {Array<string>} [levels=['public', 'undefined', 'protected']] included access levels.
* @param {Array<Object>} comments parsed comments (can be nested)
* @return {Array<Object>} filtered comments
* @returns {Array<Object>} filtered comments
*/
function filterAccess(levels: Array<string>, comments: Array<Comment>) {
function filter(comment) {
Expand Down
2 changes: 1 addition & 1 deletion src/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var getGithubURLPrefix = require('./git/url_prefix');
*
* @name linkGitHub
* @param {Object} comment parsed comment
* @return {Object} comment with github inferred
* @returns {Object} comment with github inferred
*/
module.exports = function(comment: Comment) {
var repoPath = findGit(comment.context.file);
Expand Down
2 changes: 1 addition & 1 deletion src/input/shallow.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var smartGlob = require('../smart_glob.js');
*
* @param indexes entry points
* @param config parsing options
* @return promise with parsed files
* @returns promise with parsed files
*/
module.exports = function(
indexes: Array<string | Object>,
Expand Down
2 changes: 1 addition & 1 deletion src/is_jsdoc_comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @name isJSDocComment
* @param {Object} comment an ast path of the comment
* @return {boolean} whether it is valid
* @returns {boolean} whether it is valid
*/
module.exports = function isJSDocComment(
comment /*: {
Expand Down
2 changes: 1 addition & 1 deletion src/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function lintComments(comment: Comment) {
* @private
* Extract lint instructions from comments and generate user-readable output.
* @param {Array<Object>} comments a list of comments
* @return {string} user-readable output
* @returns {string} user-readable output
*/
function formatLint(comments: Array<Comment>): string {
var vFiles = {};
Expand Down
2 changes: 1 addition & 1 deletion src/module_filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {
* @param {Object} options - An options object with `external` being a
* micromatch-compaitible glob. *NOTE:* the glob will be matched relative to
* the top-level node_modules directory for each entry point.
* @return {function} - A function for use as the module-deps `postFilter`
* @returns {function} - A function for use as the module-deps `postFilter`
* options.
*/
externals: function externalModuleFilter(
Expand Down
2 changes: 1 addition & 1 deletion src/nest.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ var nestTag = (
* This assumes that incoming comments have been flattened.
*
* @param {Object} comment input comment
* @return {Object} nested comment
* @returns {Object} nested comment
*/
var nest = (comment: Comment) =>
Object.assign(comment, {
Expand Down
2 changes: 1 addition & 1 deletion src/output/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var remark = require('remark'),
* @param {Array<Object>} comments parsed comments
* @param {Object} args Options that can customize the output
* @name formats.markdown
* @return {Promise<string>} a promise of the eventual value
* @returns {Promise<string>} a promise of the eventual value
* @public
* @example
* var documentation = require('documentation');
Expand Down
2 changes: 1 addition & 1 deletion src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ function flattenKindShorthand(result, tag, key) {
* @param {string} comment input to be parsed
* @param {Object} loc location of the input
* @param {Object} context code context of the input
* @return {Comment} an object conforming to the
* @returns {Comment} an object conforming to the
* [documentation schema](https://github.com/documentationjs/api-json)
*/
function parseJSDoc(comment: string, loc: ?Object, context: ?Object): Comment {
Expand Down
2 changes: 1 addition & 1 deletion src/parsers/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function leftPad(str, width) {
*
* @param {Object} data a chunk of data provided by module-deps
* @param {Object} config config
* @return {Array<Object>} an array of parsed comments
* @returns {Array<Object>} an array of parsed comments
*/
function parseJavaScript(data: Object, config: DocumentationConfig) {
var visited = new Set();
Expand Down
2 changes: 1 addition & 1 deletion src/sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var fs = require('fs');
*
* @param {Array<Object>} comments all comments
* @param {Object} options options from documentation.yml
* @return {number} sorting value
* @returns {number} sorting value
* @private
*/
module.exports = function sortDocs(comments: Array<Comment>, options: Object) {
Expand Down