From e82974fc724e4a410f85459f4cd3e5367939cc9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Thu, 6 Jun 2024 16:20:17 +0800 Subject: [PATCH] fix: hashbang + eslint v8 compat issue (#290) fix: hashbang + eslint v8 compat issue --- lib/rules/hashbang.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/hashbang.js b/lib/rules/hashbang.js index 5199e5b5..3b9a0fa1 100644 --- a/lib/rules/hashbang.js +++ b/lib/rules/hashbang.js @@ -50,7 +50,7 @@ function isNodeShebang(shebang, executableName) { * @returns {string} */ function getExpectedExecutableName(context) { - const extension = path.extname(context.filename) + const extension = path.extname(context.filename ?? context.getFilename()) /** @type {{ executableMap: Record }} */ const { executableMap = {} } = context.options?.[0] ?? {}