Steven Burrows 202034ff83 GUI: Added {view}-spec.js files for all main views
Change-Id: I75a50ae2689d0ab7863c8bb0546ec72ef8e9e7ea
2017-08-11 16:49:41 +00:00

35 lines
813 B
JavaScript

import gulp from 'gulp';
import eslint from 'gulp-eslint';
import gulpIf from 'gulp-if';
import path from 'path';
const files = [
'../../web/gui/src/main/webapp/app/**/*.js'
];
console.log(eslint().version);
function isFixed(file) {
// Has ESLint fixed the file contents?
return file.eslint != null && file.eslint.fixed;
}
const lint = () => {
return gulp.src(files)
.pipe(eslint({
configFile: path.join(__dirname, 'esconfig.json'),
useEslintrc: false,
// Automatically fix trivial issues
// fix: true,
}))
.pipe(eslint.format())
.pipe(gulpIf(isFixed,
gulp.dest('../../web/gui/src/main/webapp/app')
));
};
const tasks = () => {
gulp.task('lint', () => lint());
};
export default tasks();