microsoft / microsoft/node-jsonc-parser
Remove Property is not working as expected.
Open
@aeschli is already working on this.
Since May 4, 2018.
feature-request
- Dominant language
- TypeScript
- Stars
- 759
- Forks
- 66
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 7
Description
It's such a great tool to handle JSON (with comments). Thanks!
But I find that it can not pass the following test:
test('remove property', () => {
let content = '{\n "x": "y",\n // This is a comment\n "test": "1"\n}';
let edits = removeProperty(content, ['x'], formatterOptions);
assertEdit(content, edits, '{\n // This is a comment\n "test": "1"\n}');
});
I've added a comment right after the property x. What I want is to remove the property but keep the comment. But jsonc-parser removes the comment too, which I think this maybe a bug or something?
P.S. You can test this in edit.test.ts.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.