Skip to content

fix: support JSONC in config files#42

Open
aryasaatvik wants to merge 1 commit intosteipete:mainfrom
aryasaatvik:fix/jsonc-config-support
Open

fix: support JSONC in config files#42
aryasaatvik wants to merge 1 commit intosteipete:mainfrom
aryasaatvik:fix/jsonc-config-support

Conversation

@aryasaatvik
Copy link

Summary

  • Use the existing parseJsonBuffer helper (which leverages jsonc-parser) instead of JSON.parse() when reading config files
  • Enables comments (//, /* */) and trailing commas in mcporter config files
  • The jsonc-parser dependency was already present but wasn't being used for main config file parsing

Test plan

  • All existing tests pass (pnpm test)
  • Verified JSONC config files with comments are parsed correctly

Use the existing parseJsonBuffer helper (which leverages jsonc-parser)
instead of JSON.parse() when reading config files. This enables:

- Single-line comments (//)
- Multi-line comments (/* */)
- Trailing commas

The jsonc-parser dependency was already present but wasn't being used
for the main config file parsing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant