Skip to content

Commit 62e5aa6

Browse files
committed
Added lint task
1 parent 8992031 commit 62e5aa6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

jakefile.js

+20
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,23 @@ namespace('test', function () {
9090

9191
desc('Runs all tests');
9292
task('test', ['test:unit', 'test:integration', 'test:integrationClobber']);
93+
94+
desc('Runs eslint for both lib and test directories');
95+
task('lint', function (doFix) {
96+
97+
let cmd = 'eslint --format codeframe "lib/**/*.js" "test/**/*.js"';
98+
if (doFix) {
99+
cmd += ' --fix';
100+
}
101+
try {
102+
proc.execSync(cmd);
103+
}
104+
catch (err) {
105+
console.log(err.message);
106+
console.log(err.stderr.toString());
107+
console.log(err.stdout.toString());
108+
fail('eslint failed');
109+
}
110+
});
111+
112+

0 commit comments

Comments
 (0)