1 | var gulp = require('gulp'); |
||
2 | var concat = require('gulp-concat'); |
||
3 | var uglify = require('gulp-uglify'); |
||
4 | var sort = require('gulp-sort'); |
||
5 | var wppot = require('gulp-wp-pot'); |
||
6 | |||
7 | gulp.task('default', function() { |
||
8 | console.log('Use the following commands'); |
||
0 ignored issues
–
show
Debugging Code
introduced
by
![]() |
|||
9 | console.log('--------------------------'); |
||
10 | console.log('gulp js to compile the to-vehicles.js to to-vehicles.min.js'); |
||
11 | console.log('gulp compile-js to compile both JS files above'); |
||
12 | console.log('gulp watch to continue watching all files for changes, and build when changed'); |
||
13 | console.log('gulp wordpress-pot to compile the lsx-mega-menus.pot'); |
||
14 | console.log('gulp reload-node-js Copy over the .js files from teh various node modules'); |
||
15 | }); |
||
16 | |||
17 | gulp.task('js', function (done) { |
||
18 | return gulp.src('assets/js/to-vehicles.js') |
||
0 ignored issues
–
show
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.
The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression. This operator is most often used in Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator. This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements. var a,b,c;
a = 1, b = 1, c= 3;
could just as well be written as: var a,b,c;
a = 1;
b = 1;
c = 3;
To learn more about the sequence operator, please refer to the MDN. ![]() |
|||
19 | .pipe(concat('to-vehicles.min.js')) |
||
20 | .pipe(uglify()) |
||
21 | .pipe(gulp.dest('assets/js')), |
||
22 | done(); |
||
23 | }); |
||
24 | |||
25 | gulp.task('compile-js', gulp.series( ['js'] , function(done) { |
||
26 | done(); |
||
27 | })); |
||
28 | |||
29 | gulp.task('watch-js', function (done) { |
||
30 | done(); |
||
31 | return gulp.watch('assets/js/to-vehicles.js', gulp.series('compile-js')); |
||
32 | }); |
||
33 | |||
34 | gulp.task('watch', gulp.series( ['watch-js'] , function(done) { |
||
35 | done(); |
||
36 | })); |
||
37 | |||
38 | gulp.task('wordpress-pot', function (done) { |
||
39 | return gulp.src('**/*.php') |
||
0 ignored issues
–
show
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.
The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression. This operator is most often used in Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator. This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements. var a,b,c;
a = 1, b = 1, c= 3;
could just as well be written as: var a,b,c;
a = 1;
b = 1;
c = 3;
To learn more about the sequence operator, please refer to the MDN. ![]() |
|||
40 | .pipe(sort()) |
||
41 | .pipe(wppot({ |
||
42 | domain: 'to-vehicles', |
||
43 | destFile: 'to-vehicles.pot', |
||
44 | package: 'to-vehicles', |
||
45 | bugReport: 'https://www.lsdev.biz/product/tour-operator-vehicles/issues', |
||
46 | team: 'LightSpeed <[email protected]>' |
||
47 | })) |
||
48 | .pipe(gulp.dest('languages')), |
||
49 | done(); |
||
50 | }); |