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

feat: have --print-config output valid JSON data #3819

Closed
1 of 4 tasks
weilbith opened this issue Dec 7, 2023 · 0 comments · Fixed by #3863
Closed
1 of 4 tasks

feat: have --print-config output valid JSON data #3819

weilbith opened this issue Dec 7, 2023 · 0 comments · Fixed by #3863

Comments

@weilbith
Copy link

weilbith commented Dec 7, 2023

Expected Behavior

If I run commitlint --print-config --color=false I would like to be able to read a valid JSON that I can parse for example with jq. I would like to go this path, because this way it fully resolves extends settings etc. So I get the complete configuration.

Current Behavior

The output is not valid JSON as keys are not wrapped with quotation marks and single quotation marks are used for values. I tried to use sed substitution to solve the issue, but this is very complex and there any many edge-cases like quotation mark escaping in string values etc.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Print out valid JSON like JSON.stringify content to stdout.

Context

I need to access commitlint configuration parameter including presets in a bash script without node.

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

Successfully merging a pull request may close this issue.

2 participants