Skip to content

Commit

Permalink
chore: Remove unused functions (#16868)
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Feb 8, 2023
1 parent 67aa37b commit a061527
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions lib/eslint/eslint-helpers.js
Expand Up @@ -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
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -924,8 +889,6 @@ function getCacheFile(cacheFile, cwd) {

module.exports = {
isGlobPattern,
directoryExists,
fileExists,
findFiles,

isNonEmptyString,
Expand Down

0 comments on commit a061527

Please sign in to comment.