Skip to content

Conversation

@forivall
Copy link

Fixes #1

the appropriate formatting of comments should be to put most of your comment in the key itself, like:

  "// Check with maintainer before adding anything!!": null,
  "dependencies": {
    ...

This is still a work in progress to add the functionality for nested things (like the scripts field), but it passes the test I added, so 🎉

// 1: comments that precede a key
// 2: trailing comments
[[], {}, []],
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems too complicated to me.

['//z', '//x', 'z', ' //name', 'name', 'a', '// end']
 -> keys without `//`: ['z', 'x', 'name', 'a', 'end']
 -> sort: ['a', 'end', 'name', 'x', 'z']
 -> restore: ['a', `// end`, '//name', name, '//x',''x', '//z', 'z' ]

WDYT?

Copy link
Author

Choose a reason for hiding this comment

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

if anyone can think of simpler ways to do this, i'm all ears.

@forivall forivall force-pushed the feat/comments branch 2 times, most recently from efa8868 to b7b675f Compare November 26, 2020 02:07
@forivall forivall marked this pull request as ready for review November 26, 2020 03:12
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.

feature request comment-hack at the top?

2 participants