{"record":{"id":"e8b1517ad62d7d77","repo":"eslint/eslint","slug":"no-files-matching-pattern-were-found-globen","errorCode":null,"errorMessage":"No files matching '${pattern}' were found${!globEnabled ? \" (glob was disabled)\" : \"\"}.","messagePattern":"No files matching '(.+?)' were found(.+?)\\.","errorType":"exception","errorClass":"NoFilesFoundError","httpStatus":null,"severity":"error","filePath":"lib/eslint/eslint-helpers.js","lineNumber":422,"sourceCode":"\tbasePath,\n\tpatterns,\n\trawPatterns,\n\tunmatchedPatterns,\n}) {\n\tconst pattern = unmatchedPatterns[0];\n\tconst rawPattern = rawPatterns[patterns.indexOf(pattern)];\n\n\tconst patternHasMatch = await globMatch({\n\t\tbasePath,\n\t\tpattern,\n\t});\n\n\tif (patternHasMatch) {\n\t\tthrow new AllFilesIgnoredError(rawPattern);\n\t}\n\n\t// if we get here there are truly no matches\n\tthrow new NoFilesFoundError(rawPattern, true);\n}\n\n/**\n * Performs multiple glob searches in parallel.\n * @param {Object} options The options for this function.\n * @param {Map<string,GlobSearch>} options.searches\n *      A map of absolute path glob patterns to match.\n * @param {ConfigLoader} options.configLoader The config loader to use for\n *      determining what to ignore.\n * @param {boolean} options.errorOnUnmatchedPattern Determines if an\n *      unmatched glob pattern should throw an error.\n * @returns {Promise<Array<string>>} An array of matching file paths\n *      or an empty array if there are no matches.\n */\nasync function globMultiSearch({\n\tsearches,\n\tconfigLoader,\n\terrorOnUnmatchedPattern,","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/eslint/eslint/blob/87f66f4435c4df7f4f6815c939d153196ec03e3c/lib/eslint/eslint-helpers.js#L404-L440","documentation":"Thrown as NoFilesFoundError by `throwErrorForUnmatchedPatterns` (eslint-helpers.js:422) when a glob pattern matches no files on disk at all (not even with ignores disabled). `globMatch` returns false (patternHasMatch), confirming the pattern is truly unmatched. messageTemplate is 'file-not-found'.","triggerScenarios":"`ESLint#lintFiles(['nonexistent/*.js'])` where the path does not exist. `throwErrorForUnmatchedPatterns` is reached from globMultiSearch when unmatchedPatterns is non-empty and errorOnUnmatchedPattern is true.","commonSituations":"Typo in path; wrong cwd; deleted/moved files; branch-specific files linted on a different branch; glob syntax error producing a pattern that matches nothing.","solutions":["Correct the path or pattern to point at existing files.","Ensure the ESLint `cwd` option matches the directory the patterns are relative to.","Set `errorOnUnmatchedPattern: false` if missing patterns should be silently skipped.","Verify the glob syntax (e.g. use `**/*.js` not `/***/*.js`)."],"exampleFix":"// before\nconst eslint = new ESLint();\nawait eslint.lintFiles(['lib/*.jsx']); // wrong extension\n\n// after\nawait eslint.lintFiles(['lib/*.js']);","handlingStrategy":"validation","validationCode":"const fs = require('node:fs/promises');\nasync function fileOrGlobExists(cwd, pattern) {\n  try { await fs.stat(require('node:path').resolve(cwd, pattern)); return true; } catch {}\n  const { globby } = await import('fast-glob');\n  return (await globby(pattern, { cwd, dot: true })).length > 0;\n}","typeGuard":null,"tryCatchPattern":"try {\n  const results = await eslint.lintFiles([pattern]);\n} catch (err) {\n  if (err.messageTemplate === 'file-not-found') {\n    console.warn('Pattern not found:', err.messageData.pattern);\n    return [];\n  }\n  throw err;\n}","preventionTips":["Verify paths exist before linting.","Set errorOnUnmatchedPattern:false for optional inputs.","Use absolute cwd to avoid relative-path surprises."],"tags":["eslint-api","lint-files","glob","unmatched","paths"],"backgroundTag":null,"analyzedSha":"87f66f4435c4df7f4f6815c939d153196ec03e3c","analyzedAt":"2026-08-11T11:59:19.610Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}