microsoft / microsoft/node-jsonc-parser

Remove Property is not working as expected.

Aperta
#10 2 commenti 1 reazione 1 assegnatario Vedi su GitHub

@aeschli ci sta già lavorando.

Dal 4/5/2018.

feature-request
Lingua principale
TypeScript
Stelle
759
Fork
66
Merge medio
5g 10h
PR unite (30g)
7

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.