Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow comments in chromatic.config.json #1114

Closed
AdamVig opened this issue Oct 30, 2024 · 2 comments · Fixed by #1118
Closed

Allow comments in chromatic.config.json #1114

AdamVig opened this issue Oct 30, 2024 · 2 comments · Fixed by #1118
Assignees
Labels
CLI Empathy enhancement Classification: New feature or request released Verdict: This issue/pull request has been released

Comments

@AdamVig
Copy link

AdamVig commented Oct 30, 2024

Feature request

I'd like to be able to write comments in my Chromatic configuration file so that other developers on my team can understand why I configured it the way I did.

Proposed solution

Parse the configuration file with something like JSON5.

Consider supporting both chromatic.config.json and chromatic.config.jsonc (the file extension is important for editor support).

Alternative solutions

I considered using a non-standard config file path with a .jsonc extension, which would at least make my editor allow comments in the file, but the Chromatic CLI would still crash.

I guess I could strip comments from the file in CI, then pass the processed file to Chromatic... but that means I can't easily run the Chromatic CLI locally.

Additional context

chromatic.config.json is parsed with JSON.parse, which will throw an error if there are comments in the JSON.

@AdamVig AdamVig added CLI needs triage Tracking: Issue needs confirmation labels Oct 30, 2024
@jwir3 jwir3 self-assigned this Nov 5, 2024
jwir3 added a commit that referenced this issue Nov 5, 2024
This adds support for JSON5 as a configuration file language, allowing
for an extension to JSON that supports comments and other features.

Fixes CAP-2357.
Fixes #1114.
@jwir3 jwir3 added enhancement Classification: New feature or request Empathy and removed needs triage Tracking: Issue needs confirmation labels Nov 5, 2024
jwir3 added a commit that referenced this issue Nov 6, 2024
This adds support for JSON5 as a configuration file language, allowing
for an extension to JSON that supports comments and other features.

Fixes CAP-2357.
Fixes #1114.
jwir3 added a commit that referenced this issue Nov 7, 2024
This adds support for JSON5 as a configuration file language, allowing
for an extension to JSON that supports comments and other features.

Fixes CAP-2357.
Fixes #1114.
jwir3 added a commit that referenced this issue Nov 7, 2024
This adds support for JSON5 as a configuration file language, allowing
for an extension to JSON that supports comments and other features.

Fixes CAP-2357.
Fixes #1114.
jwir3 added a commit that referenced this issue Nov 7, 2024
This adds support for JSON5 as a configuration file language, allowing
for an extension to JSON that supports comments and other features.

Fixes CAP-2357.
Fixes #1114.
@chromatic-ci-bot
Copy link
Collaborator

🚀 Issue was released in v11.17.0 🚀

@chromatic-ci-bot chromatic-ci-bot added the released Verdict: This issue/pull request has been released label Nov 7, 2024
@chromatic-ci-bot
Copy link
Collaborator

🚀 Issue was released in v11.17.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Empathy enhancement Classification: New feature or request released Verdict: This issue/pull request has been released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants