Skip to content

Conversation

@rjhuijsman
Copy link
Contributor

Our style checks were adding problems when adding symlinks to directories:

  • prettier will error out if told to format a directory that doesn't contain any files it can format.
  • git will report new symlinks to directories as new files.
  • prettier will interpret symlinks to directories as directories.
  • Therefore, if adding a symlink to a directory that doesn't have any prettier-relevant files, prettier will error out.

We avoid this (and any other symlink confusion) by excluding symlinks from style checks. By definition they'll point to a real file or directory that will be getting formatted anyway.

Our style checks were adding problems when adding symlinks to directories:
* `prettier` will error out if told to format a directory that doesn't contain any files it can format.
* `git` will report new symlinks to directories as new files.
* `prettier` will interpret symlinks to directories as directories.
* Therefore, if adding a symlink to a directory that doesn't have any `prettier`-relevant files, `prettier` will error out.

We avoid this (and any other symlink confusion) by excluding symlinks from style checks. By definition they'll point to a real file or directory that will be getting formatted anyway.
@rjhuijsman rjhuijsman merged commit aededce into main Sep 15, 2025
1 check passed
@rjhuijsman rjhuijsman deleted the rjh.ignore-symlinks branch September 15, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants