@@ -149,28 +149,37 @@ export async function processFilesInteractively(aiProvider, options = {}) {
149149
150150 const result = await confirmCommit ( message , file , currentConvention ) ;
151151
152- // eslint-disable-next-line unicorn/prefer-switch
153- if ( result . action === 'accept' ) {
154- const success = await commit ( result . message ) ;
155- if ( success ) {
156- showSuccess ( `Committed: ${ file } ` ) ;
157- console . log ( `📝 ${ result . message } ` ) ;
158- committed ++ ;
159- } else {
160- showError ( `Failed to commit ${ file } ` ) ;
152+ switch ( result . action ) {
153+ case 'accept' : {
154+ const success = await commit ( result . message ) ;
155+ if ( success ) {
156+ showSuccess ( `Committed: ${ file } ` ) ;
157+ console . log ( `📝 ${ result . message } ` ) ;
158+ committed ++ ;
159+ } else {
160+ showError ( `Failed to commit ${ file } ` ) ;
161+ await unstageFile ( file ) ;
162+ skipped ++ ;
163+ }
164+
165+ fileProcessed = true ;
166+ break ;
167+ }
168+
169+ case 'regenerate' : {
170+ currentConvention = result . convention ;
171+ // Loop continues to regenerate
172+ break ;
173+ }
174+
175+ case 'skip' : {
176+ showInfo ( `Skipped: ${ file } ` ) ;
161177 await unstageFile ( file ) ;
162178 skipped ++ ;
179+ fileProcessed = true ;
180+ break ;
163181 }
164-
165- fileProcessed = true ;
166- } else if ( result . action === 'regenerate' ) {
167- currentConvention = result . convention ;
168- // Loop continues to regenerate
169- } else if ( result . action === 'skip' ) {
170- showInfo ( `Skipped: ${ file } ` ) ;
171- await unstageFile ( file ) ;
172- skipped ++ ;
173- fileProcessed = true ;
182+ // No default
174183 }
175184 } catch ( error ) {
176185 showError ( `Error processing ${ file } : ${ error . message } ` ) ;
@@ -188,9 +197,7 @@ export async function processFilesInteractively(aiProvider, options = {}) {
188197 console . log ( ` ⏭️ Skipped: ${ skipped } file(s)` ) ;
189198 console . log ( '═' . repeat ( 50 ) + '\n' ) ;
190199}
191- /* eslint-enable no-await-in-loop */
192200
193- /* eslint-disable no-await-in-loop */
194201export async function processFile ( filePath , aiProvider , options = { } ) {
195202 showInfo ( `Processing single file: ${ filePath } ` ) ;
196203 console . log ( '' ) ;
@@ -225,28 +232,31 @@ export async function processFile(filePath, aiProvider, options = {}) {
225232
226233 const result = await confirmCommit ( message , filePath , currentConvention ) ;
227234
228- if ( result . action === 'accept' ) {
229- const success = await commit ( result . message ) ;
230- if ( success ) {
231- showSuccess ( 'Changes committed successfully!' ) ;
232- console . log ( `📝 ${ result . message } ` ) ;
233- } else {
234- showError ( 'Failed to commit changes.' ) ;
235- }
235+ switch ( result . action ) {
236+ case 'accept' : {
237+ const success = await commit ( result . message ) ;
238+ if ( success ) {
239+ showSuccess ( 'Changes committed successfully!' ) ;
240+ console . log ( `📝 ${ result . message } ` ) ;
241+ } else {
242+ showError ( 'Failed to commit changes.' ) ;
243+ }
236244
237- return ;
238- }
245+ return ;
246+ }
239247
240- if ( result . action === 'regenerate' ) {
241- currentConvention = result . convention ;
242- attempts ++ ;
243- continue ;
244- }
248+ case 'regenerate' : {
249+ currentConvention = result . convention ;
250+ attempts ++ ;
251+ continue ;
252+ }
245253
246- if ( result . action === 'skip' ) {
247- showInfo ( 'Commit cancelled.' ) ;
248- await unstageFile ( filePath ) ;
249- return ;
254+ case 'skip' : {
255+ showInfo ( 'Commit cancelled.' ) ;
256+ await unstageFile ( filePath ) ;
257+ return ;
258+ }
259+ // No default
250260 }
251261 } catch ( error ) {
252262 showError ( `Error: ${ error . message } ` ) ;
0 commit comments