Skip to content

Commit 8bad174

Browse files
committed
removed all unused vars and enforced the policy in jshint
1 parent 2d95750 commit 8bad174

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

.jshintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"node": true,
33
"strict": true,
4+
"unused": true,
45
"undef": true
56
}

test/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ test('init: should pass through when file is null', function(t) {
8383
test('init: should emit an error if file content is a stream', function(t) {
8484
var pipeline = sourcemaps.init();
8585
pipeline
86-
.on('data', function(data) {
86+
.on('data', function() {
8787
t.fail('should emit an error');
8888
t.end();
8989
})

test/write.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ test('write: should pass through when file has no source map', function(t) {
100100
test('write: should emit an error if file content is a stream', function(t) {
101101
var pipeline = sourcemaps.write();
102102
pipeline
103-
.on('data', function(data) {
103+
.on('data', function() {
104104
t.fail('should emit an error');
105105
t.end();
106106
})
@@ -263,7 +263,6 @@ test('write: should create shortest path to map in file comment', function(t) {
263263
var pipeline = sourcemaps.write('dir1/maps');
264264
var fileCount = 0;
265265
var outFiles = [];
266-
var sourceMap;
267266
pipeline
268267
.on('data', function(data) {
269268
outFiles.push(data);
@@ -349,7 +348,7 @@ test('write: should set the sourceRoot by option sourceRoot', function(t) {
349348
test('write: should set the sourceRoot by option sourceRoot, as a function', function(t) {
350349
var file = makeFile();
351350
var pipeline = sourcemaps.write({
352-
sourceRoot: function(file) { return '/testSourceRoot'; }
351+
sourceRoot: function() { return '/testSourceRoot'; }
353352
});
354353
pipeline
355354
.on('data', function(data) {
@@ -364,7 +363,7 @@ test('write: should automatically determine sourceRoot if destPath is set', func
364363
var pipeline = sourcemaps.write('.', {destPath: 'dist', includeContent: false});
365364
var fileCount = 0;
366365
var outFiles = [];
367-
var sourceMap;
366+
368367
pipeline
369368
.on('data', function(data) {
370369
outFiles.push(data);
@@ -393,7 +392,7 @@ test('write: should interpret relative path in sourceRoot as relative to destina
393392
var pipeline = sourcemaps.write('.', {sourceRoot: '../src'});
394393
var fileCount = 0;
395394
var outFiles = [];
396-
var sourceMap;
395+
397396
pipeline
398397
.on('data', function(data) {
399398
outFiles.push(data);
@@ -422,7 +421,7 @@ test('write: should interpret relative path in sourceRoot as relative to destina
422421
var pipeline = sourcemaps.write('.', {sourceRoot: ''});
423422
var fileCount = 0;
424423
var outFiles = [];
425-
var sourceMap;
424+
426425
pipeline
427426
.on('data', function(data) {
428427
outFiles.push(data);
@@ -451,7 +450,7 @@ test('write: should interpret relative path in sourceRoot as relative to destina
451450
var pipeline = sourcemaps.write('maps', {sourceRoot: '../src'});
452451
var fileCount = 0;
453452
var outFiles = [];
454-
var sourceMap;
453+
455454
pipeline
456455
.on('data', function(data) {
457456
outFiles.push(data);
@@ -480,7 +479,7 @@ test('write: should interpret relative path in sourceRoot as relative to destina
480479
var pipeline = sourcemaps.write('../maps', {sourceRoot: '../src', destPath: 'dist'});
481480
var fileCount = 0;
482481
var outFiles = [];
483-
var sourceMap;
482+
484483
pipeline
485484
.on('data', function(data) {
486485
outFiles.push(data);
@@ -521,7 +520,7 @@ test('write: should accept a sourceMappingURLPrefix', function(t) {
521520
test('write: should accept a sourceMappingURLPrefix, as a function', function(t) {
522521
var file = makeFile();
523522
var pipeline = sourcemaps.write('../maps', {
524-
sourceMappingURLPrefix: function(file) { return 'https://asset-host.example.com'; }
523+
sourceMappingURLPrefix: function() { return 'https://asset-host.example.com'; }
525524
});
526525
pipeline
527526
.on('data', function(data) {
@@ -537,7 +536,7 @@ test('write: should accept a sourceMappingURLPrefix, as a function', function(t)
537536
test('write: should invoke sourceMappingURLPrefix every time', function(t) {
538537
var times = 0;
539538
var pipeline = sourcemaps.write('../maps', {
540-
sourceMappingURLPrefix: function(file) { ++times; return 'https://asset-host.example.com/' + times; }
539+
sourceMappingURLPrefix: function() { ++times; return 'https://asset-host.example.com/' + times; }
541540
});
542541

543542
pipeline
@@ -569,7 +568,7 @@ test('write: null as sourceRoot should not set the sourceRoot', function(t) {
569568
test('write: function returning null as sourceRoot should not set the sourceRoot', function(t) {
570569
var file = makeFile();
571570
var pipeline = sourcemaps.write({
572-
sourceRoot: function(file) { return null; }
571+
sourceRoot: function() { return null; }
573572
});
574573
pipeline
575574
.on('data', function(data) {
@@ -638,7 +637,7 @@ test('write: should output an error message if debug option is set and sourceCon
638637
var unhook = hookStd.stderr(function(s) {history.push(s);});
639638
var pipeline = sourcemaps.write({debug: true});
640639
pipeline
641-
.on('data', function(data) {
640+
.on('data', function() {
642641
unhook();
643642
debug.save(null);
644643
// console.log(JSON.stringify(history))

0 commit comments

Comments
 (0)