Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Bug: newly added empty files still show a `-0` diff count

Open
#399 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
frontend

Research direction

Start with FileDiff#render and the output of parsePatchFiles, using either empty-file patch from the reproduction. Check how the diff count and empty diff body are rendered; the issue also notes deleted empty files as a possible counterpart. Done means the irrelevant -0 is handled and the empty-file diff display is addressed.

Written by the indexing model from the issue text.

Description

bug diffs
Prerequisites
Describe the issue

A very "aesthetic" "issue" that could also be a feature request, but fits better in the bug category.

Parsing works fine with empty files added in a PR, but:

  • the -0 is present despite not being relevant at all. the +0 is arguably a bit weird too, but still better than what GitHub does: showing "whitespace-only change" with no diff count.
  • no diff is shown at all. this is not a real bug as there is actually nothing to show, but having a diff header with nothing inside it looks off. maybe adding a File added with no content or similar would help?

Showcase:
diff of an empty added file

[!NOTE]
The counterpart fix(es) could maybe be applied to deleted empty files too

Reproduction

Use FileDiff#render on the output of parsePatchFiles with this data:

--- /dev/null
+++ whatever.js

OR

diff --git a/whatever.js b/whatever.js
new file mode 100644
index 000000000000..e69de29bb2d1
What browser(s) are you seeing the problem on?

Chrome

What version of @pierre/diffs are you using?

1.0.11

Dominant language
TypeScript
Stars
6.2k
Forks
226
Avg merge
1d 12h
Merged PRs (30d)
34

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pierrecomputer/pierre

All issues in pierrecomputer/pierre

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.