Skip to content

Commit f9f01f6

Browse files
committed
increased strictness in jshint #30
1 parent a12ffff commit f9f01f6

File tree

11 files changed

+31
-46
lines changed

11 files changed

+31
-46
lines changed

.jshintrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
22
"node": true,
3-
"eqeqeq": true
3+
"curly": true,
4+
"eqeqeq": true,
5+
"noarg": true,
6+
"nonew": true,
7+
"undef": true,
8+
"unused": true
49
}

lib/bluebird-plus.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
'use strict';
1617
var bluebirdPlus = require('bluebird/js/main/promise')();
1718

1819
// when the last callback in a chain throws an error in the callback code,

lib/documents.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
* limitations under the License.
1515
*/
1616
'use strict';
17-
var util = require("util");
18-
var deepcopy = require('deepcopy');
1917
var valcheck = require('core-util-is');
2018

2119
var requester = require('./requester.js');
@@ -77,7 +75,7 @@ function Documents(client) {
7775
*/
7876

7977
/** @ignore */
80-
function probeOutputTransform(headers) {
78+
function probeOutputTransform(/*headers, data*/) {
8179
/*jshint validthis:true */
8280
var operation = this;
8381

@@ -559,8 +557,7 @@ function singleWriteOutputTransform(headers, data) {
559557
}
560558
/** @ignore */
561559
function writeListOutputTransform(headers, data) {
562-
/*jshint validthis:true */
563-
var operation = this;
560+
// var operation = this;
564561

565562
var systemTime = headers.systemTime;
566563
if (valcheck.isNullOrUndefined(systemTime)) {
@@ -1084,7 +1081,7 @@ function collectMetadata(document) {
10841081
}
10851082

10861083
/** @ignore */
1087-
function removeOutputTransform(headers, data) {
1084+
function removeOutputTransform(headers/*, data*/) {
10881085
/*jshint validthis:true */
10891086
var operation = this;
10901087

@@ -1210,7 +1207,7 @@ function removeDocumentImpl(contentOnly, isLegacy, args) {
12101207
return requester.startRequest(operation);
12111208
}
12121209

1213-
function removeAllOutputTransform(headers, data) {
1210+
function removeAllOutputTransform(/*headers, data*/) {
12141211
/*jshint validthis:true */
12151212
var operation = this;
12161213

@@ -1705,7 +1702,7 @@ function notNameFilter(key) {
17051702
}
17061703

17071704
/** @ignore */
1708-
function patchOutputTransform(headers, data) {
1705+
function patchOutputTransform(/*headers, data*/) {
17091706
/*jshint validthis:true */
17101707
var operation = this;
17111708

lib/extlibs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function pathErrorTransform(message) {
3737
*/
3838

3939
/** @ignore */
40-
function emptyOutputTransform(headers, data) {
40+
function emptyOutputTransform(/*headers, data*/) {
4141
/*jshint validthis:true */
4242
var operation = this;
4343

lib/mlutil.js

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -76,26 +76,6 @@ function appendItem(object, key, value) {
7676
}
7777
}
7878

79-
// TODO: retire in favour of core utils START
80-
function isBoolean(value) {
81-
return (value instanceof Boolean || (typeof value) === 'boolean');
82-
}
83-
function isNumber(value) {
84-
return (value instanceof Number || (typeof value) === 'number');
85-
}
86-
function isSet(value) {
87-
return (value !== null && value !== undefined);
88-
}
89-
function isString(value) {
90-
return (value instanceof String || (typeof value) === 'string');
91-
}
92-
//TODO: retire in favour of core utils END
93-
94-
function equalThis(other) {
95-
/*jshint validthis:true */
96-
return this === other;
97-
}
98-
9979
// isolated in function because v8 deoptimizes try/catch
10080
function parseJSON(raw) {
10181
try {
@@ -186,20 +166,27 @@ function rootname(filename) {
186166
}
187167

188168
function identify(arg, withValues) {
189-
if (arg === void 0) return 'undefined';
190-
if (arg === null) return 'null';
169+
if (arg === void 0) {
170+
return 'undefined';
171+
}
172+
if (arg === null) {
173+
return 'null';
174+
}
191175
var typed = typeof arg;
192176
switch(typed) {
193177
case 'boolean' : return withValues ? typed+' '+arg : typed;
194178
case 'function' : return typed;
195179
case 'number' : return withValues ? typed+' '+arg : typed;
196180
case 'object' :
197-
if (Array.isArray(arg))
181+
if (Array.isArray(arg)) {
198182
return withValues ? 'Array '+JSON.stringify(arg) : 'Array';
199-
if (Buffer.isBuffer(arg))
183+
}
184+
if (Buffer.isBuffer(arg)) {
200185
return 'Buffer';
201-
if (arg instanceof Error)
186+
}
187+
if (arg instanceof Error) {
202188
return withValues ? 'Error '+JSON.stringify(arg) : 'Error';
189+
}
203190

204191
var prototypeName = Object.prototype.toString.call(arg);
205192

@@ -270,10 +257,6 @@ module.exports = {
270257
Error: MarkLogicError,
271258
extension: extension,
272259
first: first,
273-
isBoolean: isBoolean,
274-
isNumber: isNumber,
275-
isSet: isSet,
276-
isString: isString,
277260
marshal: marshal,
278261
multipartBoundary: multipartBoundary,
279262
parseJSON: parseJSON,

lib/resources-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function nameErrorTransform(message) {
3737
*/
3838

3939
/** @ignore */
40-
function emptyOutputTransform(headers, data) {
40+
function emptyOutputTransform(/*headers, data*/) {
4141
/*jshint validthis:true */
4242
var operation = this;
4343

lib/responder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ QueuedReader.prototype.nextReader = function queuedReaderNextReader() {
604604
readerQueue.pollFirst().pipe(writer);
605605
}
606606
};
607-
QueuedReader.prototype._read = function queuedReaderRead(size) {
607+
QueuedReader.prototype._read = function queuedReaderRead(/*size*/) {
608608
var itemQueue = this.itemQueue;
609609
if (itemQueue === null) {
610610
return;

lib/rest-server-properties.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ RESTServerProperties.prototype.read = function readRESTServerProperties() {
5555
};
5656

5757
/** @ignore */
58-
function RESTServerPropertiesOutputTransform(headers) {
58+
function RESTServerPropertiesOutputTransform(/*headers, data*/) {
5959
/*jshint validthis:true */
6060
var operation = this;
6161

lib/transactions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var Operation = require('./operation.js');
2727
*/
2828

2929
/** @ignore */
30-
function openOutputTransform(headers, data) {
30+
function openOutputTransform(/*headers, data*/) {
3131
/*jshint validthis:true */
3232
var operation = this;
3333

@@ -149,7 +149,7 @@ Transactions.prototype.rollback = function rollbackTransaction(txid) {
149149
};
150150

151151
/** @ignore */
152-
function finishOutputTransform(headers, data) {
152+
function finishOutputTransform(/*headers, data*/) {
153153
/*jshint validthis:true */
154154
var operation = this;
155155

lib/transforms.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function nameErrorTransform(message) {
3737
*/
3838

3939
/** @ignore */
40-
function emptyOutputTransform(headers, data) {
40+
function emptyOutputTransform(/*headers, data*/) {
4141
/*jshint validthis:true */
4242
var operation = this;
4343

0 commit comments

Comments
 (0)