1- import { keyring } from '@zowe/secrets-for-zowe-sdk' ;
1+ import { keyring } from '@zowe/secrets-for-zowe-sdk' ;
22import { writeFileSync , readFileSync , existsSync , unlinkSync } from 'fs' ;
33import { join } from 'path' ;
44import { homedir } from 'os' ;
@@ -70,7 +70,7 @@ export class CredentialStorage {
7070 } else {
7171 // REMOVED: console.log('⚠ No credentials found in encrypted file');
7272 }
73- } catch ( error ) {
73+ } catch {
7474 // REMOVED: console.log('❌ Error reading encrypted file:', (error as Error)?.message);
7575 }
7676
@@ -90,15 +90,15 @@ export class CredentialStorage {
9090 // REMOVED: console.log('✓ Found credentials in OS keychain for:', account);
9191 return credentials ;
9292 }
93- } catch ( error ) {
93+ } catch {
9494 // REMOVED: console.log('⚠ Failed to retrieve credentials for account:', account);
9595 continue ;
9696 }
9797 }
9898 } else {
9999 // REMOVED: console.log('⚠ No accounts found in keychain');
100100 }
101- } catch ( error ) {
101+ } catch {
102102 // REMOVED: console.log('❌ Error accessing keychain:', (error as Error)?.message);
103103 }
104104
@@ -152,13 +152,13 @@ export class CredentialStorage {
152152 for ( const account of accounts ) {
153153 try {
154154 await keyring . deletePassword ( this . serviceName , account ) ;
155- } catch ( error ) {
155+ } catch {
156156 // Continue clearing other accounts even if one fails
157157 }
158158 }
159159 await this . clearAccountsList ( ) ;
160160 }
161- } catch ( error ) {
161+ } catch {
162162 // Continue to clear encrypted file even if keychain fails
163163 }
164164
@@ -183,7 +183,7 @@ export class CredentialStorage {
183183 const buffer = 5 * 60 * 1000 ; // 5 minutes
184184
185185 return expiresAt > ( now + buffer ) ;
186- } catch ( error ) {
186+ } catch {
187187 return false ;
188188 }
189189 }
@@ -199,7 +199,7 @@ export class CredentialStorage {
199199 const accounts = JSON . parse ( data ) ;
200200 return Array . isArray ( accounts ) ? accounts : [ ] ;
201201 }
202- } catch ( error ) {
202+ } catch {
203203 // If we can't read the accounts file, return empty array
204204 }
205205 return [ ] ;
@@ -215,7 +215,7 @@ export class CredentialStorage {
215215 const { mkdirSync } = await import ( 'fs' ) ;
216216 try {
217217 mkdirSync ( this . fallbackDir , { recursive : true } ) ;
218- } catch ( error ) {
218+ } catch {
219219 // Directory might already exist
220220 }
221221
@@ -241,7 +241,7 @@ export class CredentialStorage {
241241 if ( filtered . length !== accounts . length ) {
242242 writeFileSync ( this . accountsFile , JSON . stringify ( filtered , null , 2 ) ) ;
243243 }
244- } catch ( error ) {
244+ } catch {
245245 // Non-critical error, don't throw
246246 }
247247 }
@@ -254,7 +254,7 @@ export class CredentialStorage {
254254 if ( existsSync ( this . accountsFile ) ) {
255255 unlinkSync ( this . accountsFile ) ;
256256 }
257- } catch ( error ) {
257+ } catch {
258258 // Non-critical error, don't throw
259259 }
260260 }
@@ -269,7 +269,7 @@ export class CredentialStorage {
269269 const { mkdirSync } = await import ( 'fs' ) ;
270270 try {
271271 mkdirSync ( this . fallbackDir , { recursive : true } ) ;
272- } catch ( error ) {
272+ } catch {
273273 // Directory might already exist
274274 }
275275
@@ -311,11 +311,11 @@ export class CredentialStorage {
311311 decrypted += decipher . final ( 'utf8' ) ;
312312
313313 return JSON . parse ( decrypted ) ;
314- } catch ( error ) {
314+ } catch {
315315 // If we can't decrypt, the file might be corrupted
316316 try {
317317 unlinkSync ( this . fallbackFile ) ;
318- } catch ( unlinkError ) {
318+ } catch {
319319 // Ignore unlink errors
320320 }
321321 return null ;
@@ -330,7 +330,7 @@ export class CredentialStorage {
330330 if ( existsSync ( this . fallbackFile ) ) {
331331 unlinkSync ( this . fallbackFile ) ;
332332 }
333- } catch ( error ) {
333+ } catch {
334334 // Ignore errors when clearing
335335 }
336336 }
0 commit comments