Skip to content

Commit 7bafcaa

Browse files
committed
fixed multiple --stats output #15.. linting
1 parent 18dd2cf commit 7bafcaa

7 files changed

Lines changed: 11 additions & 20 deletions

File tree

bin/cli.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ if (options.help) {
2121
process.exit(0)
2222
}
2323

24+
var parseStream
2425
if (options.src && options.src.length) {
25-
var parseStream = parse(options)
26+
parseStream = parse(options)
2627
parseStream
2728
.on('error', function (err) {
2829
stop(err.stack, 1)
2930
})
3031
.pipe(process.stdout)
3132
} else {
32-
var parseStream = parse(options)
33+
parseStream = parse(options)
3334
parseStream.on('error', function (err) {
3435
stop(err.stack, 1)
3536
})

es5/jsdoc-parse.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ var fs = require('fs');
1111
var fileSet = require('file-set');
1212
var Transform = require('stream').Transform;
1313
var cliOptions = require('./cli-options');
14-
var os = require('os');
1514
var getTempPath = require('temp-path');
1615

1716
function tempPath() {
@@ -182,7 +181,6 @@ function getStats(data) {
182181
kinds.forEach(function (kind) {
183182
stats.identifiers[kind] = a(data).where({ kind: kind }).pluck('longname').val();
184183
});
185-
console.log(stats);
186184
return stats;
187185
}
188186

es5/publish.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
'use strict';
22

3-
var o = require('object-tools');
43
var a = require('array-tools');
54
var transform = require('./transform');
65

76
exports.publish = function (data) {
8-
var query = { '!undocumented': true, '!kind': /package|file/ };
97
var json = data().get().filter(function (i) {
108
if (i.kind === 'class') {
119
return true;

lib/jsdoc-parse.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const fs = require('fs')
88
const fileSet = require('file-set')
99
const Transform = require('stream').Transform
1010
const cliOptions = require('./cli-options')
11-
const os = require('os')
1211
const getTempPath = require('temp-path')
1312

1413
function tempPath () {
@@ -136,7 +135,7 @@ function jsdocParse (options) {
136135
self.push(data)
137136
self.push(null)
138137
done()
139-
} catch(err) {
138+
} catch (err) {
140139
done(err)
141140
}
142141
}
@@ -197,7 +196,7 @@ function getJsdocOutput (src, options, done) {
197196
var outputFile = fs.openSync(outputFilePath, 'w')
198197
var outputStderrPath = tempPath()
199198
var outputStderr = fs.openSync(outputStderrPath, 'w')
200-
var handle = cp.spawn('node', args, { stdio: [ process.stdin, outputFile, outputStderr ]})
199+
var handle = cp.spawn('node', args, { stdio: [ process.stdin, outputFile, outputStderr ] })
201200
handle.on('error', done)
202201
handle.on('close', function (code) {
203202
const stderr = fs.readFileSync(outputStderrPath, 'utf8')
@@ -216,8 +215,6 @@ function getJsdocOutput (src, options, done) {
216215
})
217216
}
218217

219-
220-
221218
/**
222219
* @param {string} - input json string
223220
* @param {object} - jsdoc-parse options
@@ -261,7 +258,6 @@ function getStats (data) {
261258
kinds.forEach(function (kind) {
262259
stats.identifiers[kind] = a(data).where({ kind: kind }).pluck('longname').val()
263260
})
264-
console.log(stats);
265261
return stats
266262
}
267263

lib/publish.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict'
2-
var o = require('object-tools')
32
var a = require('array-tools')
43
var transform = require('./transform')
54

@@ -9,7 +8,6 @@ This is a jsdoc plugin. It transforms jsdoc format data to the preferred jsdoc-p
98
@param {object} opts - An object with options information.
109
*/
1110
exports.publish = function (data) {
12-
var query = { '!undocumented': true, '!kind': /package|file/ }
1311
let json = data().get().filter(i => {
1412
if (i.kind === 'class') {
1513
return true

lib/transform.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ exports.setCodename = setCodename
1010
exports.setID = setID
1111
exports.updateIDReferences = updateIDReferences
1212

13-
exports.setData = function (d) { data = d; return this; }
14-
exports.getData = function () { return data; }
13+
exports.setData = function (d) { data = d; return this }
14+
exports.getData = function () { return data }
1515
exports.removeQuotes = removeQuotes
1616
exports.wantedProperties = wantedProperties
1717
exports.removeUnwanted = removeUnwanted
@@ -239,23 +239,23 @@ function buildTodoList (identifier) {
239239

240240
function extractTypicalName (identifier) {
241241
if (identifier.tags) {
242-
var typicalName = a.extract(identifier.tags, { title: 'typicalname'})
242+
var typicalName = a.extract(identifier.tags, { title: 'typicalname' })
243243
if (typicalName.length) identifier.typicalname = typicalName[0].value
244244
}
245245
return identifier
246246
}
247247

248248
function extractCategory (identifier) {
249249
if (identifier.tags) {
250-
var category = a.extract(identifier.tags, { title: 'category'})
250+
var category = a.extract(identifier.tags, { title: 'category' })
251251
if (category.length) identifier.category = category[0].value
252252
}
253253
return identifier
254254
}
255255

256256
function extractChainable (identifier) {
257257
if (identifier.tags) {
258-
var chainable = a.extract(identifier.tags, { title: 'chainable'})
258+
var chainable = a.extract(identifier.tags, { title: 'chainable' })
259259
if (chainable.length) identifier.chainable = true
260260
}
261261
return identifier

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"standard": {
4242
"ignore": [
43-
"test"
43+
"test", "es5", "example"
4444
]
4545
}
4646
}

0 commit comments

Comments
 (0)