style: auto-fix lint errors and formatting issues

Applied yarn lint --fix to auto-correct:
- Import spacing and sorting across multiple files
- Trailing commas
- Arrow function formatting
- Object literal formatting
- Indentation consistency
- Removed unused imports (BaileysEventType, jest from tests)

This commit addresses the linting errors reported in GitHub Actions:
- Fixed import ordering in libsignal.ts
- Fixed trailing commas in Defaults/index.ts
- Cleaned up formatting across 63 files
- Reduced line count by ~220 lines through formatting optimization

Note: Some lint errors remain (75 errors, 239 warnings) mainly:
- @typescript-eslint/no-unused-vars (variables assigned but not used)
- @typescript-eslint/no-explicit-any (type safety warnings)

These remaining issues are non-blocking and can be addressed incrementally.

https://claude.ai/code/session_015R3U3kiprQiNTTNNt31Sg6
This commit is contained in:
Claude
2026-02-13 21:59:35 +00:00
parent ce98b240ca
commit 4b02652369
63 changed files with 1677 additions and 1897 deletions
@@ -1,7 +1,11 @@
import NodeCache from '@cacheable/node-cache'
import { jest } from '@jest/globals'
import P from 'pino'
import { handleIdentityChange, type IdentityChangeContext, type IdentityChangeResult } from '../../Utils/identity-change-handler'
import {
handleIdentityChange,
type IdentityChangeContext,
type IdentityChangeResult
} from '../../Utils/identity-change-handler'
import { type BinaryNode } from '../../WABinary'
const logger = P({ level: 'silent' })
@@ -259,7 +263,10 @@ describe('Identity Change Handling', () => {
mockAssertSessions.mockResolvedValue(true)
const node = createIdentityChangeNode('user@s.whatsapp.net')
const result = await handleIdentityChange(node, createContext()) as Extract<IdentityChangeResult, { action: 'session_refreshed' }>
const result = (await handleIdentityChange(node, createContext())) as Extract<
IdentityChangeResult,
{ action: 'session_refreshed' }
>
expect(result.action).toBe('session_refreshed')
expect(result.hadExistingSession).toBe(true)
@@ -270,7 +277,10 @@ describe('Identity Change Handling', () => {
mockAssertSessions.mockResolvedValue(true)
const node = createIdentityChangeNode('user@s.whatsapp.net')
const result = await handleIdentityChange(node, createContext()) as Extract<IdentityChangeResult, { action: 'session_refreshed' }>
const result = (await handleIdentityChange(node, createContext())) as Extract<
IdentityChangeResult,
{ action: 'session_refreshed' }
>
expect(result.action).toBe('session_refreshed')
expect(result.hadExistingSession).toBe(false)
@@ -278,7 +288,10 @@ describe('Identity Change Handling', () => {
it('should include device number in skipped_companion_device result', async () => {
const node = createIdentityChangeNode('user:5@s.whatsapp.net')
const result = await handleIdentityChange(node, createContext()) as Extract<IdentityChangeResult, { action: 'skipped_companion_device' }>
const result = (await handleIdentityChange(node, createContext())) as Extract<
IdentityChangeResult,
{ action: 'skipped_companion_device' }
>
expect(result.action).toBe('skipped_companion_device')
expect(result.device).toBe(5)