Skip to content

Commit fd4d200

Browse files
committed
fix(lint): clear remaining socket-registry lint errors
- .github/actions/lib/{check-firewall.mts,platform.mjs,jq.mjs}: per-call disables for fetch/console.error/console.log. Each runs on the raw runner before setup-node — @socketsecurity/lib-stable isn't installed yet, and platform.mjs/jq.mjs use stdout as the action's contract (consumed via command substitution). - scripts/install-claude-plugins.mts: oxlint --fix added '| undefined' to 13 optional interface properties (pairs with exactOptionalPropertyTypes). - test/packages.test.mts: oxlint --fix converted a for...of array loop to the cached-length form. - scripts/npm/make-npm-override.mts: max-file-lines legitimate marker (interactive CLI driver, phases share live state).
1 parent 6541c16 commit fd4d200

6 files changed

Lines changed: 25 additions & 16 deletions

File tree

.github/actions/lib/check-firewall.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const main = async (): Promise<number> => {
4444
const timer = setTimeout(() => controller.abort(), FIREWALL_TIMEOUT_MS)
4545
timer.unref?.()
4646
try {
47+
// oxlint-disable-next-line socket/no-fetch-prefer-http-request -- composite-action helper runs on the raw runner before setup-node; @socketsecurity/lib-stable not installed yet.
4748
const res = await fetch(url, {
4849
headers: {
4950
'User-Agent': 'socket-registry-setup-action/1.0',

.github/actions/lib/jq.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ if (v == null || v === '') {
2727
process.exit(1)
2828
}
2929

30+
// oxlint-disable-next-line socket/no-console-prefer-logger -- composite-action helper runs on the raw runner before setup-node; the action's stdout IS the contract (consumed via shell command substitution).
3031
console.log(typeof v === 'string' ? v : JSON.stringify(v))

.github/actions/lib/platform.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const arch = archMap[process.arch]
2323
const platform = platformMap[process.platform]
2424

2525
if (!arch || !platform) {
26+
// oxlint-disable-next-line socket/no-console-prefer-logger -- composite-action helper runs on the raw runner before setup-node; @socketsecurity/lib-stable not installed yet.
2627
console.error(`× unsupported runner: ${process.platform}-${process.arch}`)
2728
process.exit(1)
2829
}
@@ -53,4 +54,5 @@ if (platform === 'linux') {
5354
}
5455
}
5556

57+
// oxlint-disable-next-line socket/no-console-prefer-logger -- composite-action helper runs on the raw runner before setup-node; the action's stdout IS the contract (consumed via `id: detect` output).
5658
console.log(`${platform}-${arch}${suffix}`)

scripts/install-claude-plugins.mts

Lines changed: 17 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/npm/make-npm-override.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* max-file-lines: legitimate — interactive override-generator CLI; the package-extract / license-resolve / template-pick / file-write phases share enough live state (origPkgName, sockRegPkgName, nmPkgJson, licenseContents) that splitting them produces a tangle of cross-file mutables. Only a few LOC over the soft cap. */
12
/**
23
* @file Creates Socket registry package overrides for npm packages. Interactive
34
* CLI tool that guides users through creating secure package overrides:

test/packages.test.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ for (let i = 0, { length } = ecosystems; i < length; i += 1) {
193193
)
194194

195195
// For each JS file, check if there's a corresponding type file.
196-
for (const jsFilePath of jsFilePaths) {
196+
for (let i = 0, { length } = jsFilePaths; i < length; i += 1) {
197+
const jsFilePath = jsFilePaths[i]!
197198
// Check if there's any type file in the exports.
198199
// This is a simplified check - just ensure type files exist somewhere.
199200
if (!typeFilePaths.length) {
@@ -205,6 +206,7 @@ for (let i = 0, { length } = ecosystems; i < length; i += 1) {
205206
const relativeDtsPath = trimLeadingDotSlash(dtsFilePath)
206207
expect(files.includes(relativeDtsPath)).toBe(true)
207208
}
209+
208210
}
209211
})
210212
}

0 commit comments

Comments
 (0)