@@ -29,7 +29,7 @@ const MESSAGES = {
2929 GIT_ERROR : 'Skipped because of previous git error.'
3030}
3131
32- const shouldSkipApplyModifications = ctx => {
32+ const shouldSkipApplyModifications = ( ctx ) => {
3333 // Should be skipped in case of git errors
3434 if ( ctx . gitError ) {
3535 return MESSAGES . GIT_ERROR
@@ -40,14 +40,14 @@ const shouldSkipApplyModifications = ctx => {
4040 }
4141}
4242
43- const shouldSkipRevert = ctx => {
43+ const shouldSkipRevert = ( ctx ) => {
4444 // Should be skipped in case of unknown git errors
4545 if ( ctx . gitError && ! ctx . gitApplyEmptyCommitError && ! ctx . gitRestoreUnstagedChangesError ) {
4646 return MESSAGES . GIT_ERROR
4747 }
4848}
4949
50- const shouldSkipCleanup = ctx => {
50+ const shouldSkipCleanup = ( ctx ) => {
5151 // Should be skipped in case of unknown git errors
5252 if ( ctx . gitError && ! ctx . gitApplyEmptyCommitError && ! ctx . gitRestoreUnstagedChangesError ) {
5353 return MESSAGES . GIT_ERROR
@@ -149,11 +149,11 @@ const runAll = async (
149149 } )
150150
151151 // Add files from task to match set
152- task . fileList . forEach ( file => {
152+ task . fileList . forEach ( ( file ) => {
153153 matchedFiles . add ( file )
154154 } )
155155
156- hasDeprecatedGitAdd = subTasks . some ( subTask => subTask . command === 'git add' )
156+ hasDeprecatedGitAdd = subTasks . some ( ( subTask ) => subTask . command === 'git add' )
157157
158158 chunkListrTasks . push ( {
159159 title : `Running tasks for ${ task . pattern } ` ,
@@ -184,7 +184,7 @@ const runAll = async (
184184 // Skip if the first step (backup) failed
185185 if ( ctx . gitError ) return MESSAGES . GIT_ERROR
186186 // Skip chunk when no every task is skipped (due to no matches)
187- if ( chunkListrTasks . every ( task => task . skip ( ) ) ) return 'No tasks to run.'
187+ if ( chunkListrTasks . every ( ( task ) => task . skip ( ) ) ) return 'No tasks to run.'
188188 return false
189189 }
190190 } )
@@ -199,7 +199,7 @@ const runAll = async (
199199
200200 // If all of the configured tasks should be skipped
201201 // avoid executing any lint-staged logic
202- if ( listrTasks . every ( task => task . skip ( ) ) ) {
202+ if ( listrTasks . every ( ( task ) => task . skip ( ) ) ) {
203203 logger . log ( 'No staged files match any of provided globs.' )
204204 return 'No tasks to run.'
205205 }
@@ -210,37 +210,37 @@ const runAll = async (
210210 [
211211 {
212212 title : 'Preparing...' ,
213- task : ctx => git . prepare ( ctx , shouldBackup )
213+ task : ( ctx ) => git . prepare ( ctx , shouldBackup )
214214 } ,
215215 {
216216 title : 'Hiding unstaged changes to partially staged files...' ,
217- task : ctx => git . hideUnstagedChanges ( ctx ) ,
218- enabled : ctx => ctx . hasPartiallyStagedFiles
217+ task : ( ctx ) => git . hideUnstagedChanges ( ctx ) ,
218+ enabled : ( ctx ) => ctx . hasPartiallyStagedFiles
219219 } ,
220220 ...listrTasks ,
221221 {
222222 title : 'Applying modifications...' ,
223- task : ctx => git . applyModifications ( ctx ) ,
223+ task : ( ctx ) => git . applyModifications ( ctx ) ,
224224 // Always apply back unstaged modifications when skipping backup
225- skip : ctx => shouldBackup && shouldSkipApplyModifications ( ctx )
225+ skip : ( ctx ) => shouldBackup && shouldSkipApplyModifications ( ctx )
226226 } ,
227227 {
228228 title : 'Restoring unstaged changes to partially staged files...' ,
229- task : ctx => git . restoreUnstagedChanges ( ctx ) ,
230- enabled : ctx => ctx . hasPartiallyStagedFiles ,
229+ task : ( ctx ) => git . restoreUnstagedChanges ( ctx ) ,
230+ enabled : ( ctx ) => ctx . hasPartiallyStagedFiles ,
231231 skip : shouldSkipApplyModifications
232232 } ,
233233 {
234234 title : 'Reverting to original state because of errors...' ,
235- task : ctx => git . restoreOriginalState ( ctx ) ,
236- enabled : ctx =>
235+ task : ( ctx ) => git . restoreOriginalState ( ctx ) ,
236+ enabled : ( ctx ) =>
237237 shouldBackup &&
238238 ( ctx . taskError || ctx . gitApplyEmptyCommitError || ctx . gitRestoreUnstagedChangesError ) ,
239239 skip : shouldSkipRevert
240240 } ,
241241 {
242242 title : 'Cleaning up...' ,
243- task : ctx => git . cleanup ( ctx ) ,
243+ task : ( ctx ) => git . cleanup ( ctx ) ,
244244 enabled : ( ) => shouldBackup ,
245245 skip : shouldSkipCleanup
246246 }
0 commit comments