diff --git a/packages/quicktype-core/src/language/TypeScriptFlow.ts b/packages/quicktype-core/src/language/TypeScriptFlow.ts index 52b39a581..f21202056 100644 --- a/packages/quicktype-core/src/language/TypeScriptFlow.ts +++ b/packages/quicktype-core/src/language/TypeScriptFlow.ts @@ -28,7 +28,7 @@ export const tsFlowOptions = Object.assign({}, javaScriptOptions, { "Use string instead of enum for string enums with single value", false ), - preferReadonly: new BooleanOption("prefer-readonly", "Use readonly type members", false) + readonly: new BooleanOption("readonly", "Use readonly type members", false) }); const tsFlowTypeAnnotations = { @@ -54,7 +54,7 @@ export abstract class TypeScriptFlowBaseTargetLanguage extends JavaScriptTargetL tsFlowOptions.preferUnions, tsFlowOptions.preferTypes, tsFlowOptions.preferConstValues, - tsFlowOptions.preferReadonly + tsFlowOptions.readonly ]; } @@ -173,7 +173,7 @@ export abstract class TypeScriptFlowBaseRenderer extends JavaScriptRenderer { let propertyName: Sourcelike = name; propertyName = modifySource(quotePropertyName, name); - if (this._tsFlowOptions.preferReadonly) { + if (this._tsFlowOptions.readonly) { propertyName = modifySource(_propertyName => "readonly " + _propertyName, propertyName); } diff --git a/test/languages.ts b/test/languages.ts index ffa50b9a1..791485867 100644 --- a/test/languages.ts +++ b/test/languages.ts @@ -785,7 +785,7 @@ export const TypeScriptLanguage: Language = { ["pokedex.json", { "prefer-types": "true" }], { "acronym-style": "pascal" }, { converters: "all-objects" }, - { "prefer-readonly": "true" } + { readonly: "true" } ], sourceFiles: ["src/language/TypeScript.ts"] };