Open
Description
In our emitter, we have some quite complicated logic when a certain configuration is missing, for instance, we have:
const namespace = options.namespace ?? root.Name;
which takes the namespace from the options (if any), if no, we use the namespace defined in the typespec file as namespace.
Same thing happens to library-name
, we are doing it in this way:
const libraryName = options["library-name"] ?? options.namespace ?? root.Name;
This could be cumbersome especially in the context that we are going to remove the configuration namespace
(tracking here)
To keep the logic simple, the emitter should just parse whatever in the input, and then pass them through and let the following C# generator to determine which value to fallback when one configuration is missing.