Skip to content

Commit 7558568

Browse files
committed
Use any instead of unknown for uninitialized variables
- Replace unknown types with any to satisfy Biome linter - Biome requires explicit type annotations for uninitialized variables - TypeScript errors remain at 31 (all pre-existing)
1 parent 5161aed commit 7558568

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

src/commands/optimize/ls-by-agent.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function cleanupQueryStdout(stdout: string): string {
1717
if (stdout === '') {
1818
return ''
1919
}
20-
let pkgs: unknown
20+
let pkgs: any
2121
try {
2222
pkgs = JSON.parse(stdout)
2323
} catch {}

src/commands/scan/create-scan-from-github.mts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ async function testAndDownloadManifestFiles({
291291
)
292292
logger.group()
293293
let fileCount = 0
294-
let firstFailureResult: unknown
294+
let firstFailureResult: any
295295
for (const file of files) {
296296
// eslint-disable-next-line no-await-in-loop
297297
const result = await testAndDownloadManifestFile({
@@ -397,7 +397,7 @@ async function downloadManifestFile({
397397
const downloadUrlText = await downloadUrlResponse.text()
398398
debug(`response: raw download url ${downloadUrlText}`)
399399

400-
let downloadUrl: unknown
400+
let downloadUrl: any
401401
try {
402402
downloadUrl = JSON.parse(downloadUrlText).download_url
403403
} catch {
@@ -541,7 +541,7 @@ async function getLastCommitDetails({
541541
const commitText = await commitResponse.text()
542542
debug(`response: commit ${commitText}`)
543543

544-
let lastCommit: unknown
544+
let lastCommit: any
545545
try {
546546
lastCommit = JSON.parse(commitText)?.[0]
547547
} catch {
@@ -647,7 +647,7 @@ async function getRepoDetails({
647647
const repoDetailsText = await repoDetailsResponse.text()
648648
debug(`response: repo ${repoDetailsText}`)
649649

650-
let repoDetails: unknown
650+
let repoDetails: any
651651
try {
652652
repoDetails = JSON.parse(repoDetailsText)
653653
} catch {
@@ -702,7 +702,7 @@ async function getRepoBranchTree({
702702
const treeText = await treeResponse.text()
703703
debug(`response: tree ${treeText}`)
704704

705-
let treeDetails: unknown
705+
let treeDetails: any
706706
try {
707707
treeDetails = JSON.parse(treeText)
708708
} catch {

src/utils/cli/with-subcommands.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ export async function meowWithSubcommands(
523523
// Hard override the config if instructed to do so.
524524
// The env var overrides the --flag, which overrides the persisted config
525525
// Also, when either of these are used, config updates won't persist.
526-
let configOverrideResult: unknown
526+
let configOverrideResult: any
527527
if (ENV.SOCKET_CLI_CONFIG) {
528528
configOverrideResult = overrideCachedConfig(ENV.SOCKET_CLI_CONFIG)
529529
} else if (configFlag) {

src/utils/config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ let _configFromFlag = false
248248
export function overrideCachedConfig(jsonConfig: unknown): CResult<undefined> {
249249
debugNs('notice', 'override: full config (not stored)')
250250

251-
let config: unknown
251+
let config: any
252252
try {
253253
config = JSON.parse(String(jsonConfig))
254254
if (!config || typeof config !== 'object') {

src/utils/ecosystem/environment.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ async function getAgentVersion(
295295
agentExecPath: string,
296296
cwd: string,
297297
): Promise<SemVer | undefined> {
298-
let result: unknown
298+
let result: any
299299
const quotedCmd = `\`${agent} ${FLAG_VERSION}\``
300300
debugNs('stdio', `spawn: ${quotedCmd}`)
301301
try {

src/utils/git/git.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export type RepoInfo = {
9292
export async function getRepoInfo(
9393
cwd = process.cwd(),
9494
): Promise<RepoInfo | undefined> {
95-
let info: unknown
95+
let info: any
9696
try {
9797
const result = await spawn('git', ['remote', 'get-url', 'origin'], { cwd })
9898
const remoteUrl =
@@ -375,7 +375,7 @@ export async function gitEnsureIdentity(
375375
]
376376
await Promise.all(
377377
identEntries.map(async ({ 0: prop, 1: value }) => {
378-
let configValue: unknown
378+
let configValue: any
379379
try {
380380
// Will throw with exit code 1 if the config property is not set.
381381
const gitConfigResult = await spawn(

src/utils/pnpm/lockfile.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type { LockfileObject, PackageSnapshot } from '@pnpm/lockfile.fs'
1313
import type { SemVer } from 'semver'
1414

1515
export function extractOverridesFromPnpmLockSrc(lockfileContent: any): string {
16-
let match: unknown
16+
let match: any
1717
if (typeof lockfileContent === 'string') {
1818
match = /^overrides:(?:\r?\n {2}.+)+(?:\r?\n)*/m.exec(lockfileContent)?.[0]
1919
}
@@ -64,7 +64,7 @@ export function isPnpmDepPath(maybeDepPath: string): boolean {
6464
export function parsePnpmLockfile(
6565
lockfileContent: unknown,
6666
): LockfileObject | null {
67-
let result: unknown
67+
let result: any
6868
if (typeof lockfileContent === 'string') {
6969
try {
7070
result = yaml.load(stripBom(lockfileContent))

src/utils/socket/api.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ export async function queryApiSafeText(
360360
spinner?.start(`Requesting ${description} from API...`)
361361
}
362362

363-
let result: unknown
363+
let result: any
364364
try {
365365
result = await queryApi(path, apiToken)
366366
if (description) {
@@ -495,7 +495,7 @@ export async function sendApiRequest<T>(
495495
spinner?.start(`Requesting ${description} from API...`)
496496
}
497497

498-
let result: unknown
498+
let result: any
499499
try {
500500
const fetchOptions = {
501501
method,

src/utils/socket/json.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export async function readSocketJson(
153153
}
154154
}
155155

156-
let obj: unknown
156+
let obj: any
157157
try {
158158
obj = JSON.parse(json)
159159
} catch (e) {
@@ -213,7 +213,7 @@ export function readSocketJsonSync(
213213
}
214214
}
215215

216-
let jsonObj: unknown
216+
let jsonObj: any
217217
try {
218218
jsonObj = JSON.parse(jsonContent)
219219
} catch (e) {

src/utils/update/manager.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ async function checkForUpdates(
134134
}
135135

136136
const isFresh = updateStore.isFresh(record, ttl)
137-
let updateResult: unknown
137+
let updateResult: any
138138

139139
if (!isFresh) {
140140
// Need to fetch fresh data from registry.

0 commit comments

Comments
 (0)