diff --git a/src/bin/tools/runFormat.ts b/src/bin/tools/runFormat.ts index b7a4d787..fd2eb108 100644 --- a/src/bin/tools/runFormat.ts +++ b/src/bin/tools/runFormat.ts @@ -44,7 +44,12 @@ export function runFormat(params: { packageJsonFilePath: string }) { return; } - for (const scriptName of ["format", "lint"]) { + const scriptKeys = Object.keys(scripts); + const scriptNames = scriptKeys.filter(scriptKey => + scriptKey.trim().match(/^(lint|format)/) + ); + + for (const scriptName of scriptNames) { if (!(scriptName in scripts)) { continue; }