diff --git a/pr-checks/check-cs-config.ts b/pr-checks/check-cs-config.ts index f520fc403..461f58e7b 100755 --- a/pr-checks/check-cs-config.ts +++ b/pr-checks/check-cs-config.ts @@ -95,6 +95,6 @@ function main() { return 0; } -if (require.main === module) { +if (import.meta.main) { process.exit(main()); } diff --git a/pr-checks/check-js.ts b/pr-checks/check-js.ts index 835bb0056..1927d94a2 100755 --- a/pr-checks/check-js.ts +++ b/pr-checks/check-js.ts @@ -62,6 +62,6 @@ function main() { return 0; } -if (require.main === module) { +if (import.meta.main) { process.exit(main()); } diff --git a/pr-checks/check-sarif.ts b/pr-checks/check-sarif.ts index 7c744c34c..5fd436013 100644 --- a/pr-checks/check-sarif.ts +++ b/pr-checks/check-sarif.ts @@ -120,6 +120,6 @@ function main() { } } -if (require.main === module) { +if (import.meta.main) { process.exit(main()); } diff --git a/pr-checks/update-bundle.ts b/pr-checks/update-bundle.ts index 8e4b333dc..655f2347c 100755 --- a/pr-checks/update-bundle.ts +++ b/pr-checks/update-bundle.ts @@ -88,6 +88,6 @@ function main() { return 0; } -if (require.main === module) { +if (import.meta.main) { process.exit(main()); }