summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/lib/util/glob-utils.js
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2019-03-15 13:40:34 -0400
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-03-18 07:25:31 +0100
commit1ceb6d8e9b516052e21b1dabd1ab19e3c3488e1e (patch)
treec15d034c56d46ebe3e82690f82a8a6661ddfbde8 /tools/node_modules/eslint/lib/util/glob-utils.js
parentbab55444764c72c208d6f2dd426a0208e4edaf2f (diff)
downloadnode-new-1ceb6d8e9b516052e21b1dabd1ab19e3c3488e1e.tar.gz
tools: update ESLint to 5.15.2
Update ESLint to 5.15.2 PR-URL: https://github.com/nodejs/node/pull/26687 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'tools/node_modules/eslint/lib/util/glob-utils.js')
-rw-r--r--tools/node_modules/eslint/lib/util/glob-utils.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/node_modules/eslint/lib/util/glob-utils.js b/tools/node_modules/eslint/lib/util/glob-utils.js
index b05c354439..33cb8e7c88 100644
--- a/tools/node_modules/eslint/lib/util/glob-utils.js
+++ b/tools/node_modules/eslint/lib/util/glob-utils.js
@@ -70,6 +70,10 @@ function processPath(options) {
* @private
*/
return function(pathname) {
+ if (pathname === "") {
+ return "";
+ }
+
let newPath = pathname;
const resolvedPath = path.resolve(cwd, pathname);
@@ -201,6 +205,13 @@ function listFilesToProcess(globPatterns, providedOptions) {
debug("Creating list of files to process.");
const resolvedPathsByGlobPattern = resolvedGlobPatterns.map(pattern => {
+ if (pattern === "") {
+ return [{
+ filename: "",
+ behavior: SILENTLY_IGNORE
+ }];
+ }
+
const file = path.resolve(cwd, pattern);
if (options.globInputPaths === false || (fs.existsSync(file) && fs.statSync(file).isFile())) {
@@ -240,7 +251,7 @@ function listFilesToProcess(globPatterns, providedOptions) {
});
const allPathDescriptors = resolvedPathsByGlobPattern.reduce((pathsForAllGlobs, pathsForCurrentGlob, index) => {
- if (pathsForCurrentGlob.every(pathDescriptor => pathDescriptor.behavior === SILENTLY_IGNORE)) {
+ if (pathsForCurrentGlob.every(pathDescriptor => pathDescriptor.behavior === SILENTLY_IGNORE && pathDescriptor.filename !== "")) {
throw new (pathsForCurrentGlob.length ? AllFilesIgnoredError : NoFilesFoundError)(globPatterns[index]);
}