From 3e36b55af48018b6e5ae9f077a62f9726ee8fe16 Mon Sep 17 00:00:00 2001 From: Timothy Fisher Date: Mon, 22 Aug 2022 12:51:25 +0100 Subject: [PATCH] fix: allow custom linters to use default exports --- src/valid-json.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/valid-json.js b/src/valid-json.js index 07ea162..1d85a36 100644 --- a/src/valid-json.js +++ b/src/valid-json.js @@ -13,7 +13,7 @@ const validJSON = ([{ linter } = {}], source) => { if (linter) { // use custom linter - parsed = requireNoCache(linter)(source); + parsed = requireNoCache(linter).default ? requireNoCache(linter).default(source) : requireNoCache(linter)(source); } else { parsed = parseJson(source); }