Skip to content

Fix malformed private field in package.json files#530

Open
everettbu wants to merge 1 commit into
mainfrom
fix/malformed-private-field-fusebox
Open

Fix malformed private field in package.json files#530
everettbu wants to merge 1 commit into
mainfrom
fix/malformed-private-field-fusebox

Conversation

@everettbu

Copy link
Copy Markdown

Mirror of facebook/react#35802
Original author: Pantkartik


Summary

This PR fixes a compliance issue with the npm package.json specification where the private field was incorrectly typed as a string ("true") instead of a boolean (true).

While some tools may handle this leniently, strict package scanners and validation pipelines (such as ScanCode.io) fail when encountering this malformed metadata. According to the npm documentation, the private field must be a boolean.

Approach & Changes

I conducted a codebase-wide audit to identify all instances of this pattern, rather than fixing only the reported file.

I updated the private field from "true" to true in the following files:

  1. packages/react-devtools-fusebox/package.json (Reported in #35793)
  2. compiler/packages/react-forgive/server/package.json (Identified during audit)
  3. compiler/packages/react-forgive/client/package.json (Identified during audit)

Test Plan

  • Audit: Executed a grep search (grep -r "\"private\": \"true\"" .) to confirm no other occurrences remain in the repository.
  • Validation: Verified that the modified files remain valid JSON.
  • Impact: Confirmed this is a metadata-only change that brings the repository into spec compliance without altering runtime behavior or build configurations.

Related Issues

Fixes #35793

This commit corrects the type of the 'private' field in several package.json files from string to boolean, ensuring compliance with the npm specification.
@greptile-apps

greptile-apps Bot commented Feb 16, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes a compliance issue where the private field in three package.json files was set to the string "true" instead of the boolean true, bringing the repo in line with the npm spec. The change is metadata-only and has no runtime impact.

  • Corrects "private": "true""private": true in compiler/packages/react-forgive/client/package.json, compiler/packages/react-forgive/server/package.json, and packages/react-devtools-fusebox/package.json.
  • Two of the three files (react-forgive client and server) had their trailing newlines inadvertently removed, which conflicts with the repo's .editorconfig (insert_final_newline = true). This should be fixed before merging.

Confidence Score: 4/5

  • This PR is safe to merge after restoring the missing trailing newlines in two files.
  • The core change (string to boolean for the private field) is correct and low-risk. The only issue is the accidental removal of trailing newlines in two files, which violates the repository's .editorconfig configuration. This is a minor style issue that should be easy to fix.
  • compiler/packages/react-forgive/client/package.json and compiler/packages/react-forgive/server/package.json need their trailing newlines restored.

Important Files Changed

Filename Overview
compiler/packages/react-forgive/client/package.json Correctly fixes "private": "true" to true, but inadvertently removes the trailing newline required by .editorconfig.
compiler/packages/react-forgive/server/package.json Correctly fixes "private": "true" to true, but inadvertently removes the trailing newline required by .editorconfig.
packages/react-devtools-fusebox/package.json Clean fix of "private": "true" to true with no unintended side effects.

Last reviewed commit: b68f73e

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

3 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

"@types/vscode": "^1.95.0"
}
}
} No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing trailing newline
This file's trailing newline was removed (note the \ No newline at end of file in the diff). The repository's .editorconfig specifies insert_final_newline = true for all files, and other package.json files in the repo (including the also-modified packages/react-devtools-fusebox/package.json) retain their trailing newline. Please restore it.

Suggested change
}
}
Prompt To Fix With AI
This is a comment left during a code review.
Path: compiler/packages/react-forgive/client/package.json
Line: 22:22

Comment:
**Missing trailing newline**
This file's trailing newline was removed (note the `\ No newline at end of file` in the diff). The repository's `.editorconfig` specifies `insert_final_newline = true` for all files, and other `package.json` files in the repo (including the also-modified `packages/react-devtools-fusebox/package.json`) retain their trailing newline. Please restore it.

```suggestion
}
```

How can I resolve this? If you propose a fix, please make it concise.

"vscode-languageserver-textdocument": "^1.0.12"
}
}
} No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing trailing newline
Same issue as the client package.json — the trailing newline was removed. The .editorconfig requires insert_final_newline = true. Please restore it.

Suggested change
}
}

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: compiler/packages/react-forgive/server/package.json
Line: 25:25

Comment:
**Missing trailing newline**
Same issue as the client `package.json` — the trailing newline was removed. The `.editorconfig` requires `insert_final_newline = true`. Please restore it.

```suggestion
}
```

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

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.

2 participants