Skip to content

Commit

Permalink
Added lint task
Browse files Browse the repository at this point in the history
  • Loading branch information
mde committed Apr 16, 2023
1 parent 8992031 commit 62e5aa6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions jakefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,23 @@ namespace('test', function () {

desc('Runs all tests');
task('test', ['test:unit', 'test:integration', 'test:integrationClobber']);

desc('Runs eslint for both lib and test directories');
task('lint', function (doFix) {

let cmd = 'eslint --format codeframe "lib/**/*.js" "test/**/*.js"';
if (doFix) {
cmd += ' --fix';
}
try {
proc.execSync(cmd);
}
catch (err) {
console.log(err.message);
console.log(err.stderr.toString());
console.log(err.stdout.toString());
fail('eslint failed');
}
});


0 comments on commit 62e5aa6

Please sign in to comment.