Skip to content
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"eslint": "^4.16.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-flowtype": "^2.41.0",
"flow-bin": "^0.69.0",
"flow-bin": "^0.71.0",
"fs-extra": "^5.0.0",
"husky": "^0.14.3",
"jest": "^22.1.4",
Expand Down
4 changes: 2 additions & 2 deletions src/commands/shared_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ module.exports.sharedInputOptions = {
"additional extensions to include in require() and import's search algorithm." +
'For instance, adding .es5 would allow require("adder") to find "adder.es5"',
// Ensure that the value is an array
coerce: (value: string | Array<string>) => [].concat(value),
coerce: (value: string | Array<string>): Array<string> => [].concat(value),
alias: 're'
},
'parse-extension': {
describe: 'additional extensions to parse as source code.',
// Ensure that the value is an array
coerce: (value: string | Array<string>) => [].concat(value),
coerce: (value: string | Array<string>): Array<string> => [].concat(value),
alias: 'pe'
},
private: {
Expand Down
4 changes: 2 additions & 2 deletions src/output/util/format_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function commaList(getHref, items, start, end, sep) {
* @param {boolean} prefix string to put after the type comment
* @returns {Array<Object>} suffixed and potentially prefixed type
*/
function decorate(formatted, str, prefix) {
function decorate(formatted, str, prefix): Array<Object> {
if (prefix) {
return [t(str)].concat(formatted);
}
Expand All @@ -100,7 +100,7 @@ function decorate(formatted, str, prefix) {
* formatType({ type: 'NameExpression', name: 'String' })[0].url
* // => 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String'
*/
function formatType(getHref: Function, node: ?Object) {
function formatType(getHref: Function, node: ?Object): Array<Object> {
let result = [];

if (!node) {
Expand Down
10 changes: 8 additions & 2 deletions src/sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const fs = require('fs');
* @returns {number} sorting value
* @private
*/
module.exports = function sortDocs(comments: Array<Comment>, options: Object) {
module.exports = function sortDocs(
comments: Array<Comment>,
options: Object
): Array<Comment> {
if (!options || !options.toc) {
return sortComments(comments, options && options.sortOrder);
}
Expand Down Expand Up @@ -124,7 +127,10 @@ function compareCommentsBySourceLocation(a: Comment, b: Comment): number {
return a.context.sortKey.localeCompare(b.context.sortKey);
}

function sortComments(comments: Array<Comment>, sortOrder: string) {
function sortComments(
comments: Array<Comment>,
sortOrder: string
): Array<Comment> {
return comments.sort(
sortOrder === 'alpha'
? compareCommentsByName
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2424,9 +2424,9 @@ flat-cache@^1.2.1:
graceful-fs "^4.1.2"
write "^0.2.1"

flow-bin@^0.69.0:
version "0.69.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.69.0.tgz#053159a684a6051fcbf0b71a2eb19a9679082da6"
flow-bin@^0.71.0:
version "0.71.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.71.0.tgz#fd1b27a6458c3ebaa5cb811853182ed631918b70"

flush-write-stream@^1.0.2:
version "1.0.2"
Expand Down