From a061527a0332f0edf559acfc2902a327cae098d9 Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Wed, 8 Feb 2023 00:50:14 -0700 Subject: [PATCH] chore: Remove unused functions (#16868) --- lib/eslint/eslint-helpers.js | 37 ------------------------------------ 1 file changed, 37 deletions(-) diff --git a/lib/eslint/eslint-helpers.js b/lib/eslint/eslint-helpers.js index 5c5ed299c68..806a103b0c4 100644 --- a/lib/eslint/eslint-helpers.js +++ b/lib/eslint/eslint-helpers.js @@ -568,41 +568,6 @@ async function findFiles({ ]; } - -/** - * Checks whether a file exists at the given location - * @param {string} resolvedPath A path from the CWD - * @throws {Error} As thrown by `fs.statSync` or `fs.isFile`. - * @returns {boolean} `true` if a file exists - */ -function fileExists(resolvedPath) { - try { - return fs.statSync(resolvedPath).isFile(); - } catch (error) { - if (error && (error.code === "ENOENT" || error.code === "ENOTDIR")) { - return false; - } - throw error; - } -} - -/** - * Checks whether a directory exists at the given location - * @param {string} resolvedPath A path from the CWD - * @throws {Error} As thrown by `fs.statSync` or `fs.isDirectory`. - * @returns {boolean} `true` if a directory exists - */ -function directoryExists(resolvedPath) { - try { - return fs.statSync(resolvedPath).isDirectory(); - } catch (error) { - if (error && (error.code === "ENOENT" || error.code === "ENOTDIR")) { - return false; - } - throw error; - } -} - //----------------------------------------------------------------------------- // Results-related Helpers //----------------------------------------------------------------------------- @@ -924,8 +889,6 @@ function getCacheFile(cacheFile, cwd) { module.exports = { isGlobPattern, - directoryExists, - fileExists, findFiles, isNonEmptyString,