Skip to content

Conversation

@ConradHughes
Copy link
Contributor

This is an attempt to fix issue 196, and adds tests to verify same. Hopefully the inline comment explains things adequately.

I got complaints about the absence of simple-git-hooks as well, so added it as a dev-dependency.

@changeset-bot
Copy link

changeset-bot bot commented Mar 4, 2025

🦋 Changeset detected

Latest commit: 331f6a9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
pretty-quick Patch

Not sure what this means? Click here to learn what changesets are.

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

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 4, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@@ -1,12 +1,22 @@
/* eslint-disable unicorn/filename-case */

import { promises as fsp } from 'fs'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
import { promises as fsp } from 'fs'
import fs from 'fs/promises'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

* exist, so permit nonexistent files to go through (they appear to be
* detected by suffix, so never get read).
*/
if (stat?.isDirectory()) return false
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (stat?.isDirectory()) return false
if (stat?.isDirectory()) {
return false
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@ConradHughes ConradHughes requested a review from JounQin March 4, 2025 18:33
Copy link
Member

@JounQin JounQin left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for your contribution!

@JounQin JounQin enabled auto-merge (squash) March 4, 2025 18:46
@JounQin JounQin changed the title Issue 196: fix directory symlink handling fix: directory symlink handling Mar 4, 2025
@JounQin JounQin merged commit 40b2e55 into prettier:master Mar 4, 2025
9 checks passed
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.

Directory symlink results in EISDIR failure

2 participants