fix: resolve oxlint warnings — suppress false positives, remove unused imports (#22687)

This commit is contained in:
Kit Langton
2026-04-15 21:33:54 -04:00
committed by GitHub
parent bbdbc107ae
commit f7d4665e40
80 changed files with 82 additions and 106 deletions

View File

@@ -77,11 +77,13 @@ export namespace JsonMigration {
async function read(files: string[], start: number, end: number) {
const count = end - start
// oxlint-disable-next-line unicorn/no-new-array -- pre-allocated for index-based batch fill
const tasks = new Array(count)
for (let i = 0; i < count; i++) {
tasks[i] = Filesystem.readJson(files[start + i])
}
const results = await Promise.allSettled(tasks)
// oxlint-disable-next-line unicorn/no-new-array -- pre-allocated for index-based batch fill
const items = new Array(count)
for (let i = 0; i < results.length; i++) {
const result = results[i]
@@ -243,6 +245,7 @@ export namespace JsonMigration {
for (let i = 0; i < allMessageFiles.length; i += batchSize) {
const end = Math.min(i + batchSize, allMessageFiles.length)
const batch = await read(allMessageFiles, i, end)
// oxlint-disable-next-line unicorn/no-new-array -- pre-allocated for index-based batch fill
const values = new Array(batch.length)
let count = 0
for (let j = 0; j < batch.length; j++) {
@@ -273,6 +276,7 @@ export namespace JsonMigration {
for (let i = 0; i < partFiles.length; i += batchSize) {
const end = Math.min(i + batchSize, partFiles.length)
const batch = await read(partFiles, i, end)
// oxlint-disable-next-line unicorn/no-new-array -- pre-allocated for index-based batch fill
const values = new Array(batch.length)
let count = 0
for (let j = 0; j < batch.length; j++) {