@@ -7,26 +7,24 @@ const FILES = require('../files')
77const { getWatchTask } = require ( '../utils' )
88const gulpExeca = require ( '../exec' )
99
10- const format = function ( ) {
11- const files = [ ...FILES . JAVASCRIPT ] . join ( ' ' )
12- return gulpExeca ( `prettier --write --loglevel warn ${ files } ` )
13- }
10+ const format = ( ) =>
11+ gulpExeca ( `prettier --write --loglevel warn ${ FILES . CHECK . join ( ' ' ) } ` )
1412
1513// We do not use `gulp-eslint` because it does not support --cache
16- const eslint = function ( ) {
17- const files = [ ...FILES . JAVASCRIPT , ...FILES . MARKDOWN ] . join ( ' ' )
18- return gulpExeca (
19- `eslint ${ files } --ignore-path .gitignore --fix --cache --format codeframe --max-warnings 0 --report-unused-disable-directives` ,
14+ const eslint = ( ) =>
15+ gulpExeca (
16+ `eslint ${ FILES . CHECK . join (
17+ ' ' ,
18+ ) } --ignore-path .gitignore --fix --cache --format codeframe --max-warnings 0 --report-unused-disable-directives`,
2019 )
21- }
2220
2321const lint = series ( format , eslint )
2422
2523// eslint-disable-next-line fp/no-mutation
2624lint . description = 'Lint source files'
2725
28- const dup = function ( ) {
29- return src ( [ ... FILES . JAVASCRIPT , ... FILES . MARKDOWN ] ) . pipe (
26+ const dup = ( ) =>
27+ src ( FILES . CHECK ) . pipe (
3028 jscpd ( {
3129 verbose : true ,
3230 blame : true ,
@@ -35,7 +33,6 @@ const dup = function() {
3533 'skip-comments' : true ,
3634 } ) ,
3735 )
38- }
3936
4037// eslint-disable-next-line fp/no-mutation
4138dup . description = 'Check for code duplication'
@@ -45,10 +42,7 @@ const check = parallel(lint, dup)
4542// eslint-disable-next-line fp/no-mutation
4643check . description = 'Lint and check for code duplication'
4744
48- const checkwatch = getWatchTask (
49- { JAVASCRIPT : [ lint , dup ] , MARKDOWN : [ lint , dup ] } ,
50- check ,
51- )
45+ const checkwatch = getWatchTask ( { CHECK : check } , check )
5246
5347// eslint-disable-next-line fp/no-mutation
5448checkwatch . description = 'Lint and test the application in watch mode'
0 commit comments