src/cli/expand-patterns.js/expandPatterns
function* expandPatterns(context) {
  const cwd = process.cwd();
  const seen = new Set();
  let noResults = true;

  for (const pathOrError of expandPatternsInternal(context)) {
    noResults = false;
    if (typeof pathOrError !== "string") {
      yield pathOrError;
      continue;
    }

    const relativePath = path.relative(cwd, pathOrError);

    // filter out duplicates
    if (seen.has(relativePath)) {
      continue;
    }

    seen.add(relativePath);
    yield relativePath;
  }

  if (noResults) {
    // If there was no files and no other errors, let's yield a general error.
    yield {
      error: `No matching files. Patterns: ${context.filePatterns.join(" ")}`,
    };
  }
}