forked from DAVFoundation/missioncontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
56 lines (51 loc) · 1.17 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const gulp = require('gulp');
const jest = require('gulp-jest').default;
var ts = require('gulp-typescript');
var tslint = require('gulp-tslint');
const spellcheck = require('gulp-ts-spellcheck').default;
gulp.task('jest', done => {
return gulp
.src('jest.config.js')
.on('error', function(err) {
done(err);
})
.pipe(jest({}));
});
gulp.task('tslint', done => {
return gulp
.src('src/**/*.ts')
.on('error', function(err) {
done(err);
})
.pipe(
tslint({
formatter: 'prose',
}),
)
.pipe(tslint.report());
});
gulp.task('spellcheck', function(done) {
return gulp
.src('src/**/*.ts')
.on('error', function(err) {
done(err);
})
.pipe(
spellcheck({
dictionary: require('./speller-dictionary.js'),
}),
)
.pipe(spellcheck.report({}));
});
gulp.task('tsc', function(done) {
var tsProject = ts.createProject('tsconfig.json');
return tsProject
.src()
.pipe(tsProject())
.on('error', function(err) {
done(err);
})
.js.pipe(gulp.dest('build'));
});
gulp.task('compile', gulp.series('tslint', 'tsc'));
gulp.task('test', gulp.series('compile', 'jest'));