apheleia icon indicating copy to clipboard operation
apheleia copied to clipboard

feat: add prettier-json-stringify formatter

Open danielpza opened this issue 2 years ago • 1 comments

Adds a new formatter for prettier prettier-json-stringify which uses prettier json-stringify parser. json-stringify parser is used by prettier for formatting package.json files

danielpza avatar Mar 30 '23 15:03 danielpza

I used these changes together with https://github.com/radian-software/apheleia/issues/150#issuecomment-1490513636 to make apheleia correctly format package.json files

danielpza avatar Mar 30 '23 15:03 danielpza

Looks good, mind adding a test?

@raxod502, added some tests, thanks for the patience

danielpza avatar Dec 26 '24 00:12 danielpza

Aside: @raxod502 is it possible to make this the default formatter in apheleia for "package.json" files, but not all json files?

danielpza avatar Dec 26 '24 00:12 danielpza

is it possible to make this the default formatter in apheleia for "package.json" files, but not all json files?

Yeah, you would put an entry ("/package\\.json\\'" . prettier-json-stringify) in apheleia-mode-alist.

raxod502 avatar Jan 19 '25 20:01 raxod502