Skip to content

Conversation

Diggsey
Copy link

@Diggsey Diggsey commented Jun 12, 2023

It's common in typescript to avoid in-place mutations. This PR allows fully read-only types to be generated.

For object types, this could previously already be achieved via lots of annotations, but this is tedious and there was no way to apply the "readonly" modifier to maps and arrays.

@Lucretiel
Copy link
Contributor

I'm not sure I follow; we already support read-only types via the annotation. Is the idea that this is a global override that forces all types to be readonly, regardless of annotations?

@Diggsey
Copy link
Author

Diggsey commented Jun 17, 2023

As I mentioned above, the annotations only allow you to make object properties read only. They don't allow you to make eg readonly string[].

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.

2 participants