feat(config)!: support jsonc in existing config + preset files#36141
feat(config)!: support jsonc in existing config + preset files#36141rarkins merged 9 commits intorenovatebot:mainfrom
jsonc in existing config + preset files#36141Conversation
rarkins
left a comment
There was a problem hiding this comment.
I prefer we just parse with JSONC instead of JSON.parse
jsonc in config + preset filesjsonc in config + preset files
|
I don't think this is technically a breaking change, but it's a very notable one so let's include it in v41 so there's a higher chance everyone notices. |
rarkins
left a comment
There was a problem hiding this comment.
Definitely needs some docs updating!
Where should it be added? |
|
Probably a few places where we mention coding file types. Alone should recommend using jsonc instead of json5 |
|
Is there any chance of renovate/lib/config/app-strings.ts Lines 1 to 12 in cdbaa1f |
viceice
left a comment
There was a problem hiding this comment.
is this really a breaking change?
|
@viceice I think it's strictly not a breaking change, but it's a significant one that I'd like to bundle in a major release note so increase the chance of getting more attention. I'd like to recommend jsonc instead of json5 too in future (because we can more easily write migration code) |
|
Just repeating this in case it was missed:
VS Code treats a To get rid of those errors, I can rename the file to |
|
@reduckted it's not necessary to add in v41.0.0 as it would be a new capability instead of something changed about existing functionality |
I don't understand what you mean. What a the point of supporting |
|
This not about supporting .jsonc files. It's about using JSONC parsing instead of JSON parsing for JSON files |
Interesting, why would Renovate support the JSONC syntax without supporting the Seems like that's probably confusing and has bad DX, eg. editors showing errors in the file, other tooling which expects strict JSON in I can understand it for "any config files without file extension (e.g. |
Totally agree. I know the issue says "Renovate should support JSONC for .json files", but if I didn't know this and I see that Renovate supports JSONC syntax and then I get error highlighting in my I assume that at some point in the future you're going to support |
jsonc in config + preset filesjsonc in existing config + preset files
|
We do not want to change more than is necessary in this PR. You're welcome to submit a PR after v41 which adds .jsonc support. |

Changes
json5. There, is no waya tobe sure which formatjson | jsonc | json5is present in a file before parsing it.Context
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: