mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-15 01:11:30 +02:00
- installed at build time as dependancies Change-Id: I85fd69f0b14e6fd1af2693320c1ca23c62f58ac4
33 lines
781 B
JavaScript
33 lines
781 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'
|
|
];
|
|
|
|
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(); |