Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request comment-hack at the top? #1

Open
Rolograaf opened this issue Dec 26, 2015 · 4 comments · May be fixed by #211
Open

feature request comment-hack at the top? #1

Rolograaf opened this issue Dec 26, 2015 · 4 comments · May be fixed by #211

Comments

@Rolograaf
Copy link

First: I just stumbled on this and fully satisfies my neatly needs, thanks!

But I used a hack from:
http://stackoverflow.com/questions/14221579/how-do-i-add-comments-to-package-json-for-npm-install#14221781
to make a little comment in my package.json (some dependency does not yet work in Windows, but they are working on it)
It would be nice to see the "//": "comment" above all others when it is used?

@keithamus
Copy link
Owner

Hey @Rolograaf thanks for the issue! Please, feel free to make a PR against this project and I'll happily merge it 😄

@dandv
Copy link

dandv commented Apr 30, 2020

Comments should ideally be kept with the line the precede. See this package.json with build scripts.

Sorting that way may not be trivial.

@keithamus
Copy link
Owner

Using comment markers with the same key will break, because we use JSON.stringify which removes duplicate key names, you'd have to rework the hack to append a unique string to each comment marker, e.g. //build, //test. If you did that then we could definitely sort so that they landed on top of their respective functions.

@forivall forivall linked a pull request Nov 26, 2020 that will close this issue
@jcbhmr
Copy link

jcbhmr commented Mar 18, 2023

bit offtopic sidenote: there seems to be a pseudo-standard "_readme" key https://github.com/search?q=%22_readme%22%3A+lang%3AJSON&type=code it's used in composer.lock (PHP's equivalent of npm) and others

image

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 a pull request may close this issue.

4 participants