Package.json icon at root level appears different than in a nested folder

Problem description:
If I create a file named package.json nested within a folder, its icon is the JSON icon instead of the NPM icon.

At root level, a file named package.json will always have the NPM icon.

Expected behavior:
All files with the name package.json should have the NPM icon

Actual behavior:
Files nested within another folder with the name package.json have the normal JSON icon

Steps to reproduce:

  1. Open a Repl
  2. Create a file named package.json at root level if you haven’t already
  3. Create a folder in the Repl
  4. Create a file named package.json within it
  5. Notice how the icons are different

Bug appears at this link:
Was able to reproduce in any Repl

Screenshot 2023-08-18 at 11.34.06 AM

Browser: Chrome
Device (Android, iOS, n/a leave blank): Macbook Pro 14" Ventura
Plan (Free, Hacker, Pro Plan): Pro Plan

1 Like