Skip to content

Conversation

@Timmmm
Copy link

@Timmmm Timmmm commented Nov 25, 2025

Draft RFC to add an alternative format for package.json that allows comments.

I need to look into the implementation, and I'm sure there will be bikeshedding over the actual format chosen.

Fixes #291

See also npm/cli#8751

Draft RFC to add an alternative format for package.json that allows comments.

I need to look into the implementation, and I'm sure there will be bikeshedding over the actual format chosen.
@ljharb
Copy link
Contributor

ljharb commented Nov 25, 2025

As has been discussed elsewhere, if there's not a built-in way to node (or javascript) to work with a format, then it's going to be impractical for the entire ecosystem of tooling to work with it.

@Timmmm
Copy link
Author

Timmmm commented Nov 25, 2025

The impact will be that if they want to support this optional format they need to install the json5 package (or whichever format we use). I don't understand how that is a significant issue.

@ljharb
Copy link
Contributor

ljharb commented Nov 25, 2025

What npm supports, every tool effectively must support. Why force an additional package on the entire ecosystem? That's an incredibly high cost merely for slightly more ergonomic comments.

@Timmmm
Copy link
Author

Timmmm commented Nov 25, 2025

What npm supports, every tool effectively must support.

This alternative format is optional. Third party tools can decide if they want to support it (potentially losing users) and users can decide if they want to use it (potentially losing third party tools).

Anyone that doesn't like it can happily continue using package.json as before.

slightly more ergonomic comments

It's not slightly more ergonomic comments. It's vastly more ergonomic comments for scripts and the top of the file, and it enables comments at all for dependencies which is where you really want them.

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.

[RRFC] Opt-in solution to support comments in package.json (among other features)

2 participants