glideapps / quicktype

Generate types and converters from JSON, Schema, and GraphQL
https://app.quicktype.io
Apache License 2.0
12.12k stars 1.06k forks source link

fix: Expose the prefer-const-values Typescript language setting via CLI #2426

Closed kriswest closed 10 months ago

kriswest commented 11 months ago

resolves #2345 A previous PR (#2314) introduced the ability to generate const values in Typescript but didn't expose that option correctly for use through the CLI. This one-line PR exposes the option (which works a treat!)

@DanielBretzigheimer

kriswest commented 10 months ago

@dvdsgl @schani (or any other maintainer), is there any chance of getting this one-line correction merged?

The Linux Foundation/FINOS' FDC3 Standard project uses quicktype to generate Typescript interfaces as part of its build pipeline and we're stuck with a manual process without this option (as const values resolved a problem for use in the generated TypeScript types - we found that single value string enums, the alternative to string consts in standardized messages, do not match the string values where actual typescript consts do). As we make use of quicktype for this, we're trying to contribute back on those things that we use.

kriswest commented 10 months ago

Many thanks @schani, our automation will be back up and running again shortly!