@@ -258,7 +258,7 @@ export async function discoverPackages(): Promise<PackageInfo[]> {
258258 const packages : PackageInfo [ ] = [ ]
259259
260260 for ( let i = 0 , { length } = entries ; i < length ; i += 1 ) {
261- const entry = entries [ i ]
261+ const entry = entries [ i ] !
262262 if ( ! entry . isDirectory ( ) ) {
263263 continue
264264 }
@@ -293,11 +293,11 @@ export async function checkRequiredFiles(
293293 log ( '\n[1/8] Checking required files...' , colors . blue )
294294
295295 for ( let i = 0 , { length } = packages ; i < length ; i += 1 ) {
296- const pkg = packages [ i ]
296+ const pkg = packages [ i ] !
297297 const requiredFiles : string [ ] = [ 'package.json' , 'README.md' ]
298298
299299 for ( let i = 0 , { length } = requiredFiles ; i < length ; i += 1 ) {
300- const file = requiredFiles [ i ]
300+ const file = requiredFiles [ i ] !
301301 const filePath = path . join ( pkg . path , file )
302302 if ( ! existsSync ( filePath ) ) {
303303 reportIssue (
@@ -338,7 +338,7 @@ export async function checkVitestConfig(
338338 )
339339
340340 for ( let i = 0 , { length } = vitestPackages ; i < length ; i += 1 ) {
341- const pkg = vitestPackages [ i ]
341+ const pkg = vitestPackages [ i ] !
342342 const configPath = path . join ( pkg . path , 'vitest.config.mts' )
343343 const config = await fs . readFile ( configPath , 'utf8' )
344344
@@ -396,7 +396,7 @@ export async function checkTestScripts(packages: PackageInfo[]): Promise<void> {
396396 }
397397
398398 for ( let i = 0 , { length } = packages ; i < length ; i += 1 ) {
399- const pkg = packages [ i ]
399+ const pkg = packages [ i ] !
400400 const { scripts } = pkg . pkgJson
401401
402402 if ( ! scripts || ! scripts [ 'test' ] ) {
@@ -438,7 +438,7 @@ export async function checkCoverageScripts(
438438 const jsPackages = packages . filter ( pkg => ! C_PACKAGES . has ( pkg . name ) )
439439
440440 for ( let i = 0 , { length } = jsPackages ; i < length ; i += 1 ) {
441- const pkg = jsPackages [ i ]
441+ const pkg = jsPackages [ i ] !
442442 const { devDependencies, scripts } = pkg . pkgJson
443443
444444 // Check for cover script (standardized name across the workspace).
@@ -563,7 +563,7 @@ export async function checkBuildOutputStructure(
563563 log ( '[6/8] Checking build output structure...' , colors . blue )
564564
565565 for ( let i = 0 , { length } = packages ; i < length ; i += 1 ) {
566- const pkg = packages [ i ]
566+ const pkg = packages [ i ] !
567567 const buildDir = path . join ( pkg . path , 'build' )
568568
569569 if ( ! existsSync ( buildDir ) ) {
@@ -599,7 +599,7 @@ export async function checkBuildOutputStructure(
599599 // Fall back to per-platform subdirs (binsuite, wasm, and native-addon styles).
600600 const entries = await fs . readdir ( modeDir , { withFileTypes : true } )
601601 for ( let i = 0 , { length } = entries ; i < length ; i += 1 ) {
602- const entry = entries [ i ]
602+ const entry = entries [ i ] !
603603 if ( ! entry . isDirectory ( ) ) {
604604 continue
605605 }
@@ -651,7 +651,7 @@ export async function checkPackageJsonStructure(
651651 log ( '[7/8] Checking package.json structure...' , colors . blue )
652652
653653 for ( let i = 0 , { length } = packages ; i < length ; i += 1 ) {
654- const pkg = packages [ i ]
654+ const pkg = packages [ i ] !
655655 const { description, license, name, scripts, type, version } = pkg . pkgJson
656656 const pkgJsonPath = path . join ( pkg . path , 'package.json' )
657657
@@ -777,7 +777,7 @@ export async function checkWorkspaceDependencies(
777777 log ( '[8/8] Checking workspace dependencies...' , colors . blue )
778778
779779 for ( let i = 0 , { length } = packages ; i < length ; i += 1 ) {
780- const pkg = packages [ i ]
780+ const pkg = packages [ i ] !
781781 const { dependencies = { } , devDependencies = { } } = pkg . pkgJson
782782 const allDeps = { ...dependencies , ...devDependencies }
783783 const pkgJsonPath = path . join ( pkg . path , 'package.json' )
@@ -847,7 +847,7 @@ export function collectPatterns(packages: PackageInfo[]): void {
847847 patternStats . total = packages . length
848848
849849 for ( let i = 0 , { length } = packages ; i < length ; i += 1 ) {
850- const pkg = packages [ i ]
850+ const pkg = packages [ i ] !
851851 // Collect script patterns
852852 if ( pkg . pkgJson . scripts ) {
853853 // oxlint-disable-next-line socket/prefer-cached-for-loop -- loop variable is destructured
@@ -1100,7 +1100,7 @@ export function displaySuggestions(suggestions: Suggestion[]): void {
11001100 log ( '=' . repeat ( 60 ) , colors . bright )
11011101
11021102 for ( let i = 0 , { length } = suggestions ; i < length ; i += 1 ) {
1103- const suggestion = suggestions [ i ]
1103+ const suggestion = suggestions [ i ] !
11041104 const confidenceColor =
11051105 suggestion . level === 'HIGH' || suggestion . level === 'VERY HIGH'
11061106 ? colors . green
@@ -1139,7 +1139,7 @@ export async function executeFixes(): Promise<void> {
11391139 log ( '=' . repeat ( 60 ) , colors . bright )
11401140
11411141 for ( let i = 0 , { length } = fixableIssues ; i < length ; i += 1 ) {
1142- const issue = fixableIssues [ i ]
1142+ const issue = fixableIssues [ i ] !
11431143 if ( CLI_FLAGS . dryRun ) {
11441144 log ( '\n[DRY RUN] Would fix:' , colors . yellow )
11451145 log ( ` ${ issue . file } ` , colors . blue )
@@ -1191,7 +1191,7 @@ export async function executeFixes(): Promise<void> {
11911191 log ( `Successfully fixed ${ fixedIssues . length } issue(s)` , colors . green )
11921192
11931193 for ( let i = 0 , { length } = fixedIssues ; i < length ; i += 1 ) {
1194- const fixed = fixedIssues [ i ]
1194+ const fixed = fixedIssues [ i ] !
11951195 log ( ` ✓ ${ fixed . file } ` , colors . green )
11961196 }
11971197 }
@@ -1257,8 +1257,8 @@ async function main(): Promise<void> {
12571257 ...issues . info . map ( i => i . category ) ,
12581258 ] )
12591259
1260- for ( let i = 0 , { length } = categories ; i < length ; i += 1 ) {
1261- const category = categories [ i ]
1260+ // oxlint-disable-next-line socket/prefer-cached-for-loop -- iterable is a Set (not array-indexed)
1261+ for ( const category of categories ) {
12621262 const categoryIssues = {
12631263 error : issues . error . filter ( i => i . category === category ) ,
12641264 info : issues . info . filter ( i => i . category === category ) ,
0 commit comments