Skip to content

Commit d6daaa9

Browse files
committed
added grunt build file for linting, fixed some minor lint errors
1 parent 4fc87ea commit d6daaa9

File tree

6 files changed

+46
-14
lines changed

6 files changed

+46
-14
lines changed

grunt.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = function(grunt) {
2+
// Project configuration.
3+
grunt.initConfig({
4+
pkg: '<json:package.json>',
5+
lint: {
6+
files: ['grunt.js', 'lib/**/*.js']
7+
},
8+
watch: {
9+
files: '<config:lint.files>',
10+
tasks: 'default'
11+
},
12+
jshint: {
13+
options: {
14+
curly: true,
15+
eqeqeq: true,
16+
immed: true,
17+
latedef: true,
18+
newcap: true,
19+
noarg: true,
20+
sub: true,
21+
undef: true,
22+
boss: true,
23+
eqnull: true,
24+
node: true
25+
},
26+
globals: {
27+
exports: true
28+
}
29+
}
30+
});
31+
32+
// Default task.
33+
grunt.registerTask('default', 'lint');
34+
};

lib/calculate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ exports = module.exports = function Calculate(command) {
88
} else {
99
return (p1.x === p2.x && p1.y === p2.y);
1010
}
11-
}
11+
};
1212

1313
this._calculatePadding = function(data) {
1414
if (data.video.aspect) {

lib/extensions.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports = module.exports = function Extensions() {
55
return process.env.FFMPEG_PATH;
66
}
77
return 'ffmpeg';
8-
}
8+
};
99

1010
this.toAspectRatio = function(ar) {
1111
var p = ar.split(':');
@@ -17,7 +17,7 @@ exports = module.exports = function Extensions() {
1717
y: parseInt(p[1], 10)
1818
};
1919
}
20-
}
20+
};
2121

2222
this.ffmpegTimemarkToSeconds = function(timemark) {
2323
var parts = timemark.split(':');
@@ -35,7 +35,7 @@ exports = module.exports = function Extensions() {
3535
secs += parseInt(secParts[0], 10);
3636

3737
return secs;
38-
}
38+
};
3939

4040
this.parseVersionString = function(versionstr) {
4141
var x = versionstr.split('.');
@@ -48,7 +48,7 @@ exports = module.exports = function Extensions() {
4848
minor: min,
4949
patch: pat
5050
};
51-
}
51+
};
5252

5353
this.atLeastVersion = function(actualVersion, minVersion) {
5454
var minimum = this.parseVersionString(minVersion);
@@ -67,5 +67,5 @@ exports = module.exports = function Extensions() {
6767
}
6868
}
6969
}
70-
}
70+
};
7171
};

lib/fluent-ffmpeg.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function FfmpegCommand(args) {
217217
if (!a && !b) {
218218
return 0;
219219
}
220-
while (a != 0) {
220+
while (a !== 0) {
221221
var z = b % a;
222222
b = a;
223223
a = z;

lib/index.js

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/metadata.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ exports = module.exports = function Metadata(inputfile) {
88
path = '"' + path + '"';
99
}
1010
return path;
11-
}
11+
};
1212

1313
this.inputfile = inputfile;
1414

1515
// for internal use
1616
this.getMetadata = function(inputfile, callback) {
1717
this.inputfile = inputfile;
1818
this._loadDataInternal(callback);
19-
}
19+
};
2020

2121
// for external use
2222
this.get = function(callback) {
2323
// import extensions for external call
2424
require('./extensions').apply(Metadata.prototype);
2525
this._loadDataInternal(callback);
26-
}
26+
};
2727

2828
this._loadDataInternal = function(callback) {
2929
var inputfile = this.escapedPath(this.inputfile);
@@ -117,5 +117,5 @@ exports = module.exports = function Metadata(inputfile) {
117117

118118
callback(ret);
119119
});
120-
}
120+
};
121121
};

0 commit comments

Comments
 (0)