Skip to content

feat: update readdir/readdir-glob#116

Open
43081j wants to merge 1 commit into
mainfrom
jg/bump-readdir
Open

feat: update readdir/readdir-glob#116
43081j wants to merge 1 commit into
mainfrom
jg/bump-readdir

Conversation

@43081j

@43081j 43081j commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Both have new major versions so we need a bit more code to adopt them.

Basically, the "found files" (i.e. those we traversed but haven't yet
checked if we ignore) no longer come from tiny-readdir as a result.
Instead, we have to listen to Dirent emit and build our own set.

Both have new major versions so we need a bit more code to adopt them.

Basically, the "found files" (i.e. those we traversed but haven't yet
checked if we ignore) no longer come from `tiny-readdir` as a result.
Instead, we have to listen to `Dirent` emit and build our own set.
@pkg-pr-new

pkg-pr-new Bot commented Jul 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

yarn add https://pkg.pr.new/@prettier/cli@116.tgz

commit: ebf0e7a

Comment thread src/utils.ts
import type { ContextOptions, FormatOptions, FunctionMaybe, Key, LogLevel, Options, PrettierConfigWithOverrides, PrettierPlugin } from "./types.js";
import type { PluginsOptions } from "./types.js";

type DirentWithParentPath = Dirent & { parentPath: string };

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @fabiospampinato in case you want to expose this on your Dirent type

Comment thread src/utils.ts
};

// Globs are matched against paths relative to the root, which are never prefixed with "./"
const globsNormalized = globs.map((glob) => glob.replace(/^(!*)(?:\.\/)+/, "$1"));

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabiospampinato FYI too, it seems the switch to zeptomatch means !./foo/*.ts, ./foo/*.ts, etc used to work and no longer do.

that may be the right thing to do, just flagging. we can work with it here by stripping ./

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant