From f0c5e42aabcd343726c8c17a01ec1dfd73cddb9b Mon Sep 17 00:00:00 2001 From: Silver Hong Date: Thu, 20 Nov 2025 19:32:33 +0900 Subject: [PATCH 1/2] =?UTF-8?q?path=20=ED=8C=8C=EC=8B=B1=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/typescript/compile.ts | 5 ++++- src/cli/update-strict-comments/getFilePaths.ts | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/cli/typescript/compile.ts b/src/cli/typescript/compile.ts index e5627f8..d5f4eb2 100644 --- a/src/cli/typescript/compile.ts +++ b/src/cli/typescript/compile.ts @@ -27,7 +27,9 @@ function getPathToErrorsMap(tscOutput: string[]): Map { const result = new Map(); tscOutput.forEach((error) => { - const path = resolve(process.cwd(), error.split('(')[0]); + const match = error.match(/^(.*?)(?=\(\d+,\d+\))/); + const beforePattern = match ? match[1] : error; + const path = resolve(process.cwd(), beforePattern); if (result.has(path)) { result.set(path, [...result.get(path)!, error]); @@ -35,6 +37,7 @@ function getPathToErrorsMap(tscOutput: string[]): Map { result.set(path, [error]); } }); + console.log(result); return result; } diff --git a/src/cli/update-strict-comments/getFilePaths.ts b/src/cli/update-strict-comments/getFilePaths.ts index 67e7bb1..00d15e3 100644 --- a/src/cli/update-strict-comments/getFilePaths.ts +++ b/src/cli/update-strict-comments/getFilePaths.ts @@ -4,9 +4,13 @@ import { findStrictErrors } from '../findStrictErrors'; export const getFilePathsWithErrors = async (allFilePaths: string[]) => { const errors = await findStrictErrors(allFilePaths); + console.log(errors); - const getFilePathFromErrorMessage = (error: string) => - getAbsolutePath(process.cwd(), error.split('(')[0]); + const getFilePathFromErrorMessage = (error: string) => { + const match = error.match(/^(.*?)(?=\(\d+,\d+\))/); + const beforePattern = match ? match[1] : error; + return getAbsolutePath(process.cwd(), beforePattern); + }; return [...new Set(errors.map(getFilePathFromErrorMessage))]; }; From 7bb4e43d0e0deb3b5489fa2f31f57d5eb07b31ac Mon Sep 17 00:00:00 2001 From: Silver Hong Date: Thu, 20 Nov 2025 20:17:44 +0900 Subject: [PATCH 2/2] remove console.log --- src/cli/typescript/compile.ts | 1 - src/cli/update-strict-comments/getFilePaths.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/cli/typescript/compile.ts b/src/cli/typescript/compile.ts index d5f4eb2..85af3c0 100644 --- a/src/cli/typescript/compile.ts +++ b/src/cli/typescript/compile.ts @@ -37,7 +37,6 @@ function getPathToErrorsMap(tscOutput: string[]): Map { result.set(path, [error]); } }); - console.log(result); return result; } diff --git a/src/cli/update-strict-comments/getFilePaths.ts b/src/cli/update-strict-comments/getFilePaths.ts index 00d15e3..0d7fc7d 100644 --- a/src/cli/update-strict-comments/getFilePaths.ts +++ b/src/cli/update-strict-comments/getFilePaths.ts @@ -4,7 +4,6 @@ import { findStrictErrors } from '../findStrictErrors'; export const getFilePathsWithErrors = async (allFilePaths: string[]) => { const errors = await findStrictErrors(allFilePaths); - console.log(errors); const getFilePathFromErrorMessage = (error: string) => { const match = error.match(/^(.*?)(?=\(\d+,\d+\))/);