Skip to content

Instantly share code, notes, and snippets.

@DamianEdwards
Last active November 6, 2024 21:20
Show Gist options
  • Save DamianEdwards/31d2457737304ca73556 to your computer and use it in GitHub Desktop.
Save DamianEdwards/31d2457737304ca73556 to your computer and use it in GitHub Desktop.
JSON comments on GH

What happens if you tell GitHub it's JSON

{
  "hello": "world" // I want my comments!
}

Use jsonc as the language instead

{
  "hello": "world" // I want my comments!
}

Or just tell GitHub it's JavaScript

{
  "hello": "world" // I want my comments!
}
{
"hello": "world" // I want my comments!
}
@ElectricRCAircraftGuy
Copy link

ElectricRCAircraftGuy commented Jan 25, 2023

Thanks! I just wrote about this here, and referenced you: Stack Overflow: Can comments be used in JSON?

@whyboris
Copy link

whyboris commented Jun 2, 2023

Testing today:

```json

{
  "hello": "world" // comment
}

```jsonc

{
  "hello": "world" // comment
}

```json5

{
  "hello": "world" // comment
}

@tskxz
Copy link

tskxz commented Nov 6, 2024

testing

{
  "test": 1234 // using jsonc
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment