You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(lint): clear new socket/* rule violations from the fleet cascade
Apply autofixes from `socket/prefer-cached-for-loop`,
`socket/prefer-node-builtin-imports`, and `socket/sort-equality-disjunctions`
across the script and config surface, plus manual rewrites where the
autofix bailed (destructured `for...of`, non-bare iterable expressions,
and nested `for (const pattern of ESCALATION_PATTERNS)` loops).
Notable fixups:
- `packages/iocraft/index.mjs`: the `prefer-node-builtin-imports`
autofix rewrote `import { arch, platform } from 'node:os'` to
`import os from 'node:os'` but didn't update the call sites — fix
them to `os.platform()` / `os.arch()` so the module still runs.
- `packages/iocraft/index.mjs`: restore `export default iocraft`
with an inline disable. The umbrella package's documented public
API is `import iocraft from '@socketaddon/iocraft'`; switching to a
named export would be a breaking consumer-visible change.
- `.config/vitest.config.mts`: inline disable for `no-default-export`
— Vitest config files must use `export default defineConfig(...)`.
- `scripts/publish.mts`: bypass the `max-file-lines` soft cap with
the documented `max-file-lines: legitimate` marker. The file is a
linear publish-orchestration script whose phases (download/verify,
stage, rewrite deps, dry-run, publish, cleanup) are best read top
to bottom; splitting would scatter the per-phase context.
- Add `!` non-null assertions on the new indexed accesses introduced
by the cached-length for-loop rewrites so `noUncheckedIndexedAccess`
still passes.
Copy file name to clipboardExpand all lines: packages/iocraft/index.mjs
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,13 @@
6
6
*/
7
7
8
8
import{createRequire}from'node:module'
9
-
import{arch,platform}from'node:os'
9
+
importosfrom'node:os'
10
10
11
11
constrequire=createRequire(import.meta.url)
12
12
13
13
exportfunctiongetPlatformIdentifier(){
14
-
constplatformName=platform()
15
-
constarchName=arch()
14
+
constplatformName=os.platform()
15
+
constarchName=os.arch()
16
16
17
17
if(
18
18
platformName!=='darwin'&&
@@ -80,4 +80,5 @@ export function loadNativeAddon() {
80
80
81
81
constiocraft=loadNativeAddon()
82
82
83
+
// oxlint-disable-next-line socket/no-default-export -- Published package public API (`@socketaddon/iocraft`); the documented consumer pattern is `import iocraft from '@socketaddon/iocraft'`.
Copy file name to clipboardExpand all lines: scripts/publish.mts
+15-7Lines changed: 15 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
/* max-file-lines: legitimate -- Linear publish-orchestration script: download/verify, stage, rewrite deps, dry-run, publish, cleanup. Splitting would scatter the per-phase context across files and obscure the order-of-operations the file header documents. */
1
2
/**
2
3
* Publish all `@socketaddon/*` packages to npm.
3
4
*
@@ -271,7 +272,8 @@ export function readWorkspaceCatalog(
// oxlint-disable-next-line socket/prefer-cached-for-loop -- `Object.entries(deps)` is a one-shot iterator; a cached-length loop would need a Map/Array materialization that defeats the optimization.
317
321
for(const[name,spec]ofObject.entries(deps)){
318
322
if(
319
323
spec==='workspace:*'||
@@ -431,7 +435,8 @@ async function main(): Promise<void> {
431
435
)
432
436
// Include all per-platform packages in the version map so the umbrella's
433
437
// optionalDependencies can resolve even if --platforms filters the publish set.
0 commit comments