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): convert file-scope oxlint disables to per-call (batch 1)
11 files converted from file-scope `/* oxlint-disable socket/<rule> */`
to inline `oxlint-disable-next-line <rule> -- <reason>` per call site,
per the new socket/no-file-scope-oxlint-disable rule.
Several files were entirely `for...of` over non-array iterables
(Map.entries, Object.entries, destructured tuples) where the
prefer-cached-for-loop rule's autofix is unsafe; the new rule's per-
call disable shape carries the per-site reason next to each loop.
Files: scripts/util/{run-command,git-helpers,package}.mts,
.github/actions/lib/read-pinned-version.mts,
scripts/ci/{inline-action-versions-as-shas,generate-actions-allow-list}.mts,
scripts/lint.mts,
scripts/validation/npm-packages.mts (already clean after strip — emoji
not in the rule's denylist),
scripts/testing/validate-package-tests.mts (clean after strip; the
file-scope block was the 3 lines pushing it over the 500-line cap),
scripts/npm/{install-npm-packages,release-npm-packages}.mts (clean
after strip).
Copy file name to clipboardExpand all lines: scripts/ci/inline-action-versions-as-shas.mts
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,6 @@
1
1
/**
2
2
* @file Convert GitHub Actions tags/branches to commit SHAs in workflow files.
3
3
*/
4
-
/* oxlint-disable socket/prefer-cached-for-loop -- iterates `usesStatements.slice().reverse()` / non-array iterables; the cached-length rewrite would be incorrect or lose the reverse pass. */
Copy file name to clipboardExpand all lines: scripts/lint.mts
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,6 @@
2
2
* @file Unified lint runner with flag-based configuration. Provides smart
3
3
* linting that can target affected files or lint everything.
4
4
*/
5
-
/* oxlint-disable socket/prefer-cached-for-loop -- iterates a configured linter list (destructured loop variable); the cached-length rewrite would be incorrect. */
6
5
7
6
import{existsSync,readFileSync}from'node:fs'
8
7
importpathfrom'node:path'
@@ -188,6 +187,7 @@ export async function runLintOnFiles(
188
187
},
189
188
]
190
189
190
+
// oxlint-disable-next-line socket/prefer-cached-for-loop -- destructured linter-config tuple; cached-length rewrite would scatter the destructure.
/* oxlint-disable socket/prefer-cached-for-loop -- iterates destructured records and async-settled results; the cached-length rewrite would be incorrect. */
3
1
4
2
/**
5
3
* @file Validates package overrides before release to catch test infrastructure
Copy file name to clipboardExpand all lines: scripts/util/git-helpers.mts
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,3 @@
1
-
/* oxlint-disable socket/no-process-cwd-in-scripts-hooks -- every exported helper accepts a `cwd` parameter the caller can override; the `process.cwd()` defaults are convenience for ad-hoc invocations and don't bypass the anchor-on-script-location rule. */
2
1
/**
3
2
* @file Git helper functions for listing staged / unstaged / changed files. All
4
3
* returned paths are relative to the git top-level, so downstream glob
@@ -79,6 +78,7 @@ export function filterRelativeToRoot(
79
78
/**
80
79
* Get changed files synchronously (paths relative to git root).
81
80
*/
81
+
// oxlint-disable-next-line socket/no-process-cwd-in-scripts-hooks -- helper accepts cwd; process.cwd() is the ad-hoc-invocation default, not a bypass of the anchor-on-script-location rule.
// oxlint-disable-next-line socket/no-process-cwd-in-scripts-hooks -- helper accepts cwd; process.cwd() is the ad-hoc-invocation default, not a bypass of the anchor-on-script-location rule.
* Get staged files synchronously (paths relative to git root).
122
123
*/
124
+
// oxlint-disable-next-line socket/no-process-cwd-in-scripts-hooks -- helper accepts cwd; process.cwd() is the ad-hoc-invocation default, not a bypass of the anchor-on-script-location rule.
* Get unstaged files (paths relative to git root).
144
146
*/
147
+
// oxlint-disable-next-line socket/no-process-cwd-in-scripts-hooks -- helper accepts cwd; process.cwd() is the ad-hoc-invocation default, not a bypass of the anchor-on-script-location rule.
* Get unstaged files synchronously (paths relative to git root).
163
166
*/
167
+
// oxlint-disable-next-line socket/no-process-cwd-in-scripts-hooks -- helper accepts cwd; process.cwd() is the ad-hoc-invocation default, not a bypass of the anchor-on-script-location rule.
@@ -194,6 +199,7 @@ export async function isUnstaged(
194
199
/**
195
200
* Check if a file is unstaged synchronously.
196
201
*/
202
+
// oxlint-disable-next-line socket/no-process-cwd-in-scripts-hooks -- helper accepts cwd; process.cwd() is the ad-hoc-invocation default, not a bypass of the anchor-on-script-location rule.
Copy file name to clipboardExpand all lines: scripts/util/package.mts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
1
/* max-file-lines: legitimate — shared package.json toolkit; every helper is co-consumed by multiple npm scripts and splitting would fan-out imports without a real domain seam (only ~22 LOC over the soft cap). */
2
-
/* oxlint-disable socket/prefer-cached-for-loop -- iterates Object.entries() of script tables; the cached-length rewrite would be incorrect. */
3
2
/**
4
3
* @file Common utilities for working with package.json files. Provides helper
5
4
* functions for reading, updating, and managing package.json files across the
@@ -344,6 +343,7 @@ export async function installPackageForTesting(
344
343
345
344
// Preserve test:* scripts and the exact key 'tests', but not unrelated
346
345
// names like 'testsuite' that merely begin with 'tests'.
346
+
// oxlint-disable-next-line socket/prefer-cached-for-loop -- iterates Object.entries() (non-array iterable); cached-length would be incorrect.
// oxlint-disable-next-line socket/prefer-cached-for-loop -- destructured command-list record; the cached-length rewrite would lose the destructuring shape.
0 commit comments