-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
33 lines (29 loc) · 866 Bytes
/
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
'use strict';
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
htmlhint_inline = require('./index.js');
gulp.task('lint', function () {
return gulp.src('./*.js')
.pipe(jshint())
.pipe(jshint.reporter('default', { verbose: true }))
.pipe(jshint.reporter('fail'));
});
gulp.task('test', function () {
var options = {
htmlhintrc: './.htmlhintrc',
ignores: {
'<?php': '?>'
},
patterns: [
{
match: /hoge/g,
replacement: 'fuga'
}
]
};
return gulp.src('test/*.phtml')
.pipe(htmlhint_inline(options))
.pipe(htmlhint_inline.reporter())
.pipe(htmlhint_inline.reporter('fail'));
});
gulp.task('default', gulp.series('lint', 'test'));