diff --git a/bin/exempt-lint.mjs b/bin/exempt-lint.mjs index 08652ad05..64d564e71 100755 --- a/bin/exempt-lint.mjs +++ b/bin/exempt-lint.mjs @@ -16,6 +16,9 @@ import fs from "node:fs/promises"; +// Nodejs v18 compatibility (v18 is end-of-life in april 2025) +if(!("crypto" in globalThis)) globalThis.crypto = (await import("node:crypto")).webcrypto; + const lintRule = process.argv[2]; if (!lintRule) { throw new Error( diff --git a/bin/sync-lint-exemptions.mjs b/bin/sync-lint-exemptions.mjs index cbf18fe3c..ea7614b68 100755 --- a/bin/sync-lint-exemptions.mjs +++ b/bin/sync-lint-exemptions.mjs @@ -11,6 +11,9 @@ import fs from "node:fs/promises"; +// Nodejs v18 compatibility (v18 is end-of-life in april 2025) +if(!("crypto" in globalThis)) globalThis.crypto = (await import("node:crypto")).webcrypto; + const exemptionsFilePath = "../apps/lint_exemptions.js"; const exemptions = (await import(exemptionsFilePath)).default;