Skip to content

Conversation

@lishaduck
Copy link
Member

@lishaduck lishaduck commented Jan 31, 2026

PR Checklist

Overview

❤️‍🔥

I don't remember if this works, I whipped this up on a 6-hour car ride to Oklahoma yesterday.

@vercel
Copy link

vercel bot commented Jan 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flint Ready Ready Preview, Comment Feb 1, 2026 3:30am

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Jan 31, 2026

⚠️ No Changeset found

Latest commit: 44e0308

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines +12 to +15
export function findConfigFileName(host: LinterHost) {
const children = new Set(
host.readDirectory(host.getCurrentDirectory()).map((file) => file.name),
);
Copy link
Member Author

Choose a reason for hiding this comment

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

I think we need the host to be async-first, blocking second. @auvred, is there a reason why the host is synchronous-first beyond that typescript is synchronous? Can we rename readDirectory to like readDirectorySync for ts and make readDirectory the promised version?

Also is there a reason getCurrentDirectory is a function? It's always constant. I really couldn't care less, if it's a style choice that's fine by me, but I'm mildly curious. Wouldn't it be more efficient (on a nano-optimization level ofc) to make it property?

const cwd = process.cwd();
const configFileName = await findConfigFileName(cwd);
const host = createDiskBackedLinterHost(process.cwd());
const configFileName = findConfigFileName(host);
Copy link
Member Author

Choose a reason for hiding this comment

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

Should we still pass in the rootDir here? I feel like we don't need to if it's just an internal utility, but I could also see the benefit to being explicit and acting like all of our utilities are micro-libraries we happen to bundle.

Comment on lines +37 to +43
export interface WatchDirectoryOptions extends WatchOptions {
recursive: boolean;
}

export interface WatchOptions extends Abortable {
pollingInterval?: number;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm a Deno guy, I want my options bags.
Moreover, when I'm a Pythonista I use Ruff... where boolean-default-value-positional-argument reminds me not to fall into the boolean trap (we should totally port that rule!). Also I know we don't like the magicNumbers rule, for good reason. Moving numbers to options bags helps there too... I guess that's the "numbers trap"?

I'm happy to move these back, but putting signal as yet-another-argument felt silly and it's pretty ecosystem-standard to put signal in an object. And at that point the rest of them wanted to get moved too.

@lishaduck
Copy link
Member Author

We really need a better way to do stacked PRs, this is stacked on #2199 so I have to keep this in draft but that stops it from showing up the review queue when this is equally ready for review... 🤔

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.

2 participants