From 596442a4399c4a654347f9f63ca04c4f916a56aa Mon Sep 17 00:00:00 2001 From: vsoftic Date: Thu, 24 Aug 2017 07:48:39 +0200 Subject: [PATCH] feat(tasks): add lint tasks adds lint tasks for js and ts using respectively eslint or tslint --- lib/resources/tasks/lint.js | 10 ++++++++++ lib/resources/tasks/lint.json | 6 ++++++ lib/resources/tasks/lint.ts | 11 +++++++++++ 3 files changed, 27 insertions(+) create mode 100644 lib/resources/tasks/lint.js create mode 100644 lib/resources/tasks/lint.json create mode 100644 lib/resources/tasks/lint.ts diff --git a/lib/resources/tasks/lint.js b/lib/resources/tasks/lint.js new file mode 100644 index 000000000..e5d5f9d7d --- /dev/null +++ b/lib/resources/tasks/lint.js @@ -0,0 +1,10 @@ +import gulp from 'gulp'; +import eslint from 'gulp-eslint'; +import project from '../aurelia.json'; + +export default function lint() { + return gulp.src([project.transpiler.source]) + .pipe(eslint()) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()); +} diff --git a/lib/resources/tasks/lint.json b/lib/resources/tasks/lint.json new file mode 100644 index 000000000..105c56382 --- /dev/null +++ b/lib/resources/tasks/lint.json @@ -0,0 +1,6 @@ +{ + "name": "lint", + "description": "Lint source files", + "flags": [ + ] +} diff --git a/lib/resources/tasks/lint.ts b/lib/resources/tasks/lint.ts new file mode 100644 index 000000000..eb4285c9c --- /dev/null +++ b/lib/resources/tasks/lint.ts @@ -0,0 +1,11 @@ +import * as gulp from 'gulp'; +import tslint from 'gulp-tslint'; +import * as project from '../aurelia.json'; + +export default function lint() { + return gulp.src([project.transpiler.source]) + .pipe(tslint({ + tslint: require("tslint") + })) + .pipe(tslint.report("prose")); +}