fisker Cheung

Results 1279 comments of fisker Cheung

For the ones who don't like trailing comma, add this to your `.prettierrc` ```jsonc { "overrides": [ { "files": [ "*.jsonc", "devcontainer.json", "jsconfig.json", "language-configuration.json", "tsconfig.json", ], "options": { // Use...

> @fisker It won't work in markdown code blocks as I mentioned at [#15956 (comment)](https://github.com/prettier/prettier/issues/15956#issuecomment-1899804017) Change to `json`/`plaintext`, our `json` parser support comments.

We never said it's valid JSON, we said it's valid JSONC. If you think we are wrong, please correct the parser yourself. We have `.prettierrc` to use. This also off...

`json-stringify` is for standard JSON. `json` works for both JSON JSONC JSON5 even JSON6.

> You didn't consider other tools as I mentioned. Shouldn't you check with other tools instead? > However, it will not work with other editors or GitHub itself. What does...

> I want to format the content as jsonc without trailing comma, so that, without comments, it's valid json, some kind like Request a new parser, new language support. In...

> I think it's fair for other tools to assume that a file that has the .json extension is valid JSON. Then other tools are wrong, `tsconfig.json` is not a...

> They aren't standard, and they are discouraged. I didn't say we'll be insistent on inserting the trailing commas, this issue is labeled with `status:needs discussion`. I'm posting a solution...

I have a proposal here, let's still insert a trailing comma for `.jsonc` files and other files considered JSONC file by default (because it's prettier), but if a JSONC file...

> What happens when the nodeBeforeCursor ends up after nodeAfterCursor in the formatted doc Is this the reason why you add `cursorStart`/`cursorEnd`?