From 85063b9072dc0d394f5d20001ab176b8858b29b0 Mon Sep 17 00:00:00 2001 From: Mint Thompson Date: Fri, 4 Sep 2026 08:51:46 -0400 Subject: [PATCH] Break long lists of errors into chunks When running with no error limit, the error output table can become long enough to hit node's internal string length limit. Break the table into chunks to reduce the chance of this happening. The currently implemented chunk size is 1000. --- src/commands.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/commands.ts b/src/commands.ts index 7572f40..a68129f 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -20,6 +20,8 @@ const REQUIREMENT_DATES = new Map([ ["3.0.0", "effective January 1, 2026 and enforced April 1, 2026"], ]) +const OUTPUT_CHUNK_SIZE = 1000 + export async function validate( filepath: string, version: string, @@ -94,7 +96,18 @@ export async function validate( `${errors.length === 1 ? "1 error" : `${errors.length} errors`} found` ) ) - console.table(errors) + for ( + let errorChunk = 0; + errorChunk * OUTPUT_CHUNK_SIZE < errors.length; + errorChunk++ + ) { + console.table( + errors.slice( + errorChunk * OUTPUT_CHUNK_SIZE, + (errorChunk + 1) * OUTPUT_CHUNK_SIZE + ) + ) + } } else { console.log(chalk.green("No errors found")) }