From ff75442274db59ed2447fb4d9700cdfbe8dbf669 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 25 Feb 2025 08:47:04 +0800 Subject: [PATCH] Prevent reading `.editorconfig` in `getParser` (#17169) --- src/common/get-file-info.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/get-file-info.js b/src/common/get-file-info.js index 409a1a857..d29b8ae51 100644 --- a/src/common/get-file-info.js +++ b/src/common/get-file-info.js @@ -45,7 +45,10 @@ async function getFileInfo(file, options) { async function getParser(file, options) { let config; if (options.resolveConfig !== false) { - config = await resolveConfig(file); + config = await resolveConfig(file, { + // No need read `.editorconfig` + editorconfig: false, + }); } return config?.parser ?? inferParser(options, { physicalFile: file });